I have an NDB model. Once the data in the model becomes stale, I want to remove stale data items from searches and updates. I could have deleted them, which is explained in this SO post, if not for the need to analyze old data later. I see two choices
- adding a boolean status field, and simply mark entities deleted
- move entities to a different model
My understanding of the trade off between these two options
- mark-deleted is faster
- mark-deleted is more error prone: having extra column would require modifying all the queries to exclude entities that are marked deleted. That will increase complexity and probability of bugs.
Question: Can move-entities option be made fast enough to be comparable to mark-deleted? Any sample code as to how to move entities between models efficiently?
Update: 2014-05-14, I decided for the time being to use mark-deleted. I figure there is an additional benefit of fewer RPCs.
Related: