What happens to a transaction if the server crashes right after COMMIT?
Demystifying ACID Transactions: How Databases Prevent Chaos and Keep Your Data Safe
5 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? 🙂
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 EngineerExasoft Pte Ltd · Full time · Singapore
- DATACOM SME (Data Communication Subject Matter Expert; all genders)NTT DATA, Inc. · Full time · United Kingdom
- Data-Data Engineer-AdvancedInfinity Quest UK · Full time · France
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!