What happens to a transaction if the server crashes right after COMMIT?
Demystifying ACID Transactions: How Databases Prevent Chaos and Keep Your Data Safe
9 Comments
@[Spyros] Great question! That’s where Durability comes in. Once the database acknowledges COMMIT, the transaction should survive a server crash.
The database persists the committed changes before confirming the commit, so even if it crashes immediately afterwards, the transaction should still be there after recovery.
Please log in to add a comment.
Nice introduction to ACID. One thing I've always found interesting is how quickly the simple definitions start getting complicated once you ask where the database's responsibility ends and the application's begins.
Consistency is probably my favorite example. A database can enforce the constraints and invariants we've actually expressed, but it has no idea whether the resulting state makes sense to the business. I can have a perfectly valid transaction that commits perfectly incorrect data.
Isolation gets interesting too. Two concurrent transactions don't necessarily execute one after the other; the database may interleave them while providing an isolation level that determines what each is allowed to observe.
So perhaps the slightly mischievous follow-up question is: how much of "ACID keeps your data safe" is actually ACID, and how much depends on developers correctly defining what "safe" means in the first place? 🙂
@[Ken W. Alger] Absolutely! 🙂 ACID provides the foundation for data safety, but developers still need to define what “correct” means for the business.
And I agree on isolation—transactions don’t simply run one after another; the isolation level determines what concurrent transactions can see.
Great perspective! 👏
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- You Tube
- Tiktok
- Premium Subscription
- Terms of Service
- Early Builders
More From saurav_tb_pandey
Related Jobs
- Data Privacy ManagerLex Dinamica Ltd · Full time · Italian Republic
- Senior Data Engineer IHeartland Business Systems Inc · Full time · Springfield, MO
- Data Engineer IIJack Henry & Associates · Full time · Springfield, MO
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!