Avoiding the soft delete anti-pattern · Cultured Systems
Programmers hate deleting things; we’ve all felt that feeling in the pit our stomach when we realise that thing we deleted was really deleted, and on the other hand the security of deleting some unused code, safe in the knowledge that it’s still really there in version control. In the sphere of databases, this terror of deleting things leads people to advocate soft deletion: instead of really deleting a record, you add a field which marks the record as deleted, and you treat any record marked in that way as if it were deleted. This is generally a bad idea, and there are a number of better ways of ensuring access to old data. The main problem with soft deletion is that you’re systematically misleading the database. This is most obvious in the case of foreign key constraints. If it’s important to your data integrity that some column in one table references a row that exists in another table, a foreign key constraint instructs the database to enforce that by, among other things, preventin
Avoiding the soft delete anti-pattern · Cultured Systems Cultured Systems © 2024. All rights reserved. Avoiding the soft delete anti-pattern 24 Apr 2024 Programmers hate deleting things; we’ve all felt that feeling in the pit our stomach when we realise that thing we deleted was really deleted, and on the other hand the security of deleting some unused code, safe in the knowledge that it’s still really there in version control. In the sphere of databases, this terror of deleting things leads people to advocate soft deletion : instead of really deleting a record, you add a field whi
Explore this link on the map →related reading
- Everything I know about good system designseangoedecke.com
- The only scalable delete in Postgres is DROP TABLE — PlanetScaleplanetscale.com
- A More Human Approach To Databasesccorcos.github.io
- Building data-centric apps with a reactive relational databaseriffle.systems
- Cleaned-up transcript of Rich Hickey's talk "Deconstructing the Database" · GitHubgist.github.com
- Century-Scale Storagelil.law.harvard.edu
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- SQLAlchemy Cascading Deletes - DEV Communitydev.to
- Database Migrationsvadimkravcenko.com
- Build Your Own Databasenan.fyi
- Evolutionary Database Designmartinfowler.com