Skip to main content
3 of 4
edited title
Robert Sösemann
  • 38.2k
  • 29
  • 173
  • 508

How to archive & restore Custom Objects in Big Objects

For my app I want to build a Archive and Restore functionality. For a given Custom Object MyObject__c and a Big Object ArchivedMyObject__c those requirements need to be fulfilled:

  • MyObject__c records are archived (original is deleted) using a scheduled batch.
  • ArchivedMyObject__c can be restored back into Custom Objects

While building this I ran into some conceptual/technical challenges:

  1. Should restored records be deleted as Big Objects?
  2. As the CreatedDate changes after a Restore should there be a custom OriginalCreatedDate__c?
  3. If restored Big Objects are not deleted how can I make sure I don't archive duplicates over and over again?
  4. I've read about Big Object upsert when doing Async Soql Write. Can I use this for duplicate prevention?
  5. I also read about idempotent Big Object Storage. What does it mean? Must the Index match or ALL field values?
  6. Does the index play a role at all in duplicate handling?
  7. Not every org has AsyncSOQL. Can I also batch-restore millions of records? Or what is the real reason for AsyncSOQL? Data volume, query flexibility? I don't get it.
  8. What happens if the customer reaches the 1 Mio. Big Object limit? Will it fail immediately.
Robert Sösemann
  • 38.2k
  • 29
  • 173
  • 508