logoalt Hacker News

cjyesterday at 10:32 PM1 replyview on HN

We 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.


Replies

vjvjvjvjghvyesterday at 10:40 PM

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.

show 1 reply