Home platformOS Logo

Data Backup and Removal

Last edit: Apr 17, 2020

This article describes how removed data is backed up and when it is removed permanently.

What is deleted_at

Every record that you create in our database has a couple of properties built-in. One of those properties is deleted_at which is null when the record is created.
When you delete a record, our system by default fills this property with a datetime of the delete operation.

For example, you can delete a record like this:

mutation DefaultDelete {
  model_delete(id: "3") {
    deleted_at
  	id
  }
}

From now on, most GraphQL queries will not show those records anymore. You can get them again by filtering records by existing deleted_at property (deleted_at: { exists: true }).

Fo example:

query models {
  models(
    per_page: 10
    filter: {
      deleted_at: { exists: true }
    }
  ) {
    results {
      deleted_at
      id
    }
  }
}

Automatic delayed permanent removal

After 30 days of the date set in deleted_at, the data will be permanently deleted at 5am UTC.

For example, if deleted_at is 2020-03-15T14:28:48.153Z (15 March 2020, 14:28 PM), the record will be deleted 30 days later at 5am (14 April 2020, 5 AM). Until this date you can still recover it by setting deleted_at to null.

Warning

If a record has been permanently deleted, you will not be able to recover it in any way.

Manual permanent removal

You can force permanent removal by setting the deleted_at value to a date more than 30 days ago.

For example:

You want the record to be deleted as soon as possible.
Assume it is 30 April 2020, you would set deleted_at to a date that is more than 30 days ago, for example March 10, which means it will be permanently deleted in the next purge process at 5am UTC.

mutation Delete {
  model_update(
    id: "3"
    model: {
      deleted_at: "2020-03-15T14:28:48.153Z"
    }
  ) {
    id
  }
}

Warning

If a record has been permanently deleted, you will not be able to recover it in any way.

Undeleting data

If you want to bring back a record, you can nullify deleted_at and this record will not be marked as deleted.

mutation Undelete {
  model_update(
    id: "3"
    model: { deleted_at: null }
  ) {
    id
  }
}

You can also set deleted_at to a different, future date to prolong its permanent removal, or move date backwards to speed up its removal.

Contribute to this page

Github Icon

Questions?

We are always happy to help with any questions you may have.

contact us