For my app I want to build a Archive and Restore functionality. For a given Custom Object MyObject__c
and a Big Object ArchivedMyObject__cArchivedMyObject__b
those requirements need to be fulfilled:
MyObject__c
records are archived (original is deleted) using a scheduled batch.ArchivedMyObject__cArchivedMyObject__b
can be restored back into Custom Objects
While building this I ran into some conceptual/technical challenges:
- Should restored records be deleted as Big Objects?
- As the
CreatedDate
changes after a Restore should there be a customOriginalCreatedDate__c
? - If restored Big Objects are not deleted how can I make sure I don't archive duplicates over and over again?
- I've read about Big Object upsert when doing Async Soql Write. Can I use this for duplicate prevention?
- I also read about idempotent Big Object Storage. What does it mean? Must the Index match or ALL field values?
- Does the index play a role at all in duplicate handling?
- Not every org has
AsyncSOQL
. Can I also batch-restore millions of records? Or what is the real reason forAsyncSOQL
? Data volume, query flexibility? I don't get it. - What happens if the customer reaches the 1 Mio. Big Object limit? Will it fail immediately.