The challenges of soft delete
atlas9.dev
The challenges of soft delete
1–10 of 157 posts
Re: The challenges of soft delete
#2This works well especially in cases where you don’t want to waste CPU/memory scanning soft deleted records every time you do a lookup.
And avoids situations where app/backend logic forgets to apply the “deleted: false” filter.
Re: The challenges of soft delete
#3We deal with soft delete in a Mongo app with hundreds of millions of records by simply moving the objects to a separate collection (table) separate from the “not deleted” data. This works well especially in cases where you don’t want to waste CPU/memory scanning soft deleted records every time you do a lookup. And avoids situations where app/backend logic forgets to apply the “deleted: false” filter.
Re: The challenges of soft delete
#4Now instead of chasing down different systems and backups, you can simply set ensure your archival process runs regularly and you should be good.
Re: The challenges of soft delete
#5Re: The challenges of soft delete
#6We deal with soft delete in a Mongo app with hundreds of millions of records by simply moving the objects to a separate collection (table) separate from the “not deleted” data. This works well especially in cases where you don’t want to waste CPU/memory scanning soft deleted records every time you do a lookup. And avoids situations where app/backend logic forgets to apply the “deleted: false” filter.
I guess that works well with NoSQL. In a relational database it gets harder to move record out if they have relationships with other tables.
Re: The challenges of soft delete
#7Earlier quoted context omitted.
I guess that works well with NoSQL. In a relational database it gets harder to move record out if they have relationships with other tables.
Eh you could implement this pretty simply with postgres table partitions
Re: The challenges of soft delete
#8The data archive serialized the schema of the deleted object representative the schema in that point in time.
But fast-forward some schema changes, now your system has to migrate the archived objects to the current schema?
Re: The challenges of soft delete
#9A good solution here (can be) to utilize a view. The underlying table has soft-delete field and the view will hide rows that have been soft deleted. Then the application doesn't need to worry about this concern all over the place.
Re: The challenges of soft delete
#10Earlier quoted context omitted.
Eh you could implement this pretty simply with postgres table partitions
Ah, that's an interesting idea! I had never considered using partitions. I might write a followup post with these new ideas.