Urgent.News

What's breaking now, across thousands of outlets.

Tech

Two Transactions, One Row: What Does MySQL Actually Let You See ?

Two users, One database row, Both reading and writing at almost exactly the same time. Who sees what ? Can one transaction see another transaction’s uncommitted changes ? Can the same query return different results inside a single transaction ? And why does SELECT sometimes give you a snapshot, while SELECT ... FOR UPDATE gives you something completely different ? If you’ve ever wondered what…

In a scenario where a customer makes an e-commerce purchase, multiple database operations occur simultaneously: checking inventory, decreasing stock, creating an order, recording payment, and updating order status. If inventory is decreased but the order creation fails, the database may end up with a negative inventory and a missing order.

Transactions prevent this by treating multiple operations as a single logical unit, either succeeding or rolling back. ACID (Atomicity, Consistency, Isolation, Durability) is a set of properties that ensure transactions maintain data integrity. Isolation level determines what data a transaction can see while others are running. Four isolation levels are available in MySQL: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, and SERIALIZABLE.

READ UNCOMMITTED allows transactions to see uncommitted changes from others, leading to dirty reads and potential inconsistencies. READ COMMITTED ensures only committed changes are seen, but the data can change while the transaction runs, leading to non-repeatable reads. REPEATABLE READ provides a consistent snapshot for the transaction, preventing non-repeatable reads.

SERIALIZABLE guarantees the highest level of isolation, ensuring that transactions appear to execute serially. Understanding these levels helps developers predict how MySQL behaves with concurrent transactions and avoid unexpected data inconsistencies.

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

The clerk who never says "I didn't do that"

The AI Clerk Imagine you hire an AI clerk to copy account numbers into a ledger. They are fast , they are polite , they never complain about the work.

  • Two AI models omit information 21.7% and 3.3% of the time
  • Models show no indication of decision to omit data
  • Businesses should test AI models with specific data and tasks

Daylight Saving Time 2026: Why Modern Time Tracking Shouldn’t Fear the Repeated Hour

On October 25, 2026 , Germany will switch from daylight saving time back to standard time. For people, that means one extra hour of sleep.

  • Germany reverts to standard time on October 25, 2026, adding an extra hour of sleep
  • Daylight saving shift serves as test for software's time management capabilities
  • Time-tracking systems must differentiate between time points, durations, and displayed local times

More from Sunday 13 September →