Urgent.News

One page, thousands of outlets. See who else covered it.

Editions

Tech

Your Database Is Making 4 Promises. Here's What ACID Means.

Introduction Your program keeps opening transactions. A signup writes a new user row. A checkout debits one account and credits another. A form submission updates three related tables at once. You wrap it all in BEGIN and COMMIT and move on, trusting that the database will handle whatever happens in between. Most of the time it does. But what is it actually promising you when it handles that? And…

Your program often runs multiple database operations within a single transaction. This is common for things like signing up a user, processing a purchase, or updating several related tables simultaneously. You wrap all these operations inside a BEGIN and COMMIT pair, trusting the database to handle everything safely in between. Most of the time, it manages this perfectly.

But sometimes, a crash can interrupt a transaction mid-way. Consider a user transferring ₹1,000 from Account A to Account B. The database runs two updates - subtract ₹1,000 from Account A and add ₹1,000 to Account B. If the server crashes right after the first update, Account A ends up with a debit of -₹1,000 while Account B shows no change.

The money never moved, and there's no error message to explain this. This demonstrates the exact problem ACID was designed to solve. ACID stands for Atomicity, Consistency, Isolation, Durability - four guarantees the system ensures for any transaction. Atomicity is the most fundamental promise. It guarantees that all parts of a transaction happen together as one indivisible unit.

If any part fails, the entire transaction is rolled back, leaving no partial results. So in the transfer example, if the second update fails, both updates are undone, ensuring the user's balance doesn't disappear unexpectedly. Atomicity prevents the unreliable situation where a transaction leaves behind an incomplete state that other transactions can observe.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Block Scope in JavaScript

Block scope is an important concept in JavaScript. It means that a variable can be accessed only inside the block where it is declared. A block is usually written using curly braces { } .

Has your license plate been tracked by Flock? Here's how to check.

The website HaveIBeenFlocked has compiled a database of 4.6 million license plate records that have appeared in roughly 242 million Flock searches.

  • HaveIBeenFlocked.com lets public check if license plate searched in Flock's system.
  • Website uses data from audit logs of Flock's 242 million searches, not storing user info.
  • Flock's cameras track license plates for law enforcement, but system has misuse allegations.

Understanding chmod Without Memorizing Numbers

How Linux file permissions actually work under the hood, why symbolic mode is your best friend, and how to stop blindly typing chmod 777. Every Linux engineer has been there.

  • Symbolic mode simplifies chmod by using letters instead of numbers.
  • File mode string in ls -l shows read/write/execute permissions.
  • Chmod u+x adds execute permission for user without changing others.

How Python Takes Out Its Own Garbage

Python manages memory automatically, freeing developers from manual allocation and deallocation. It does this through two complementary mechanisms: reference counting and a generational garbage…

More from Monday 17 August →