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
I'm Saurav Pandey, a Full Stack Developer specializ... Show moreFull Stack Developer | 3+ Years of Experience
I'm Saurav Pandey, a Full Stack Developer specializing in JavaScript, TypeScript, React.js, Node.js, and cloud technologies.
I enjoy building scalable applications, designing robust APIs, working with microservices, and optimizing application performance.
Beyond professional development, I'm passionate about open source and building reusable developer tools, including React Hook Lab.
Always curious about new technologies, solving complex engineering challenges, and turning ideas into reliable software. Show less
More From saurav_tb_pandey
Related Jobs
- Data Center MEP Superintendent: Lead Safety & ScheduleSuffolkconstruction · Full time · Turkey, TX
- Data Center Operations TechnicianChronoScale Corporation · Full time · Silverton, TX
- Assistant Project Manager, Data CentersSuffolk Construction · Full time · Turkey, TX
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!