1. Better Resource Usage
Example: Restaurant Kitchen
-
Chef 1 cooking (using stove)
-
Chef 2 chopping vegetables (using counter)
-
Chef 3 washing dishes (using sink)
-
All work simultaneously = faster service
Database Version:
-
Transaction 1 using CPU for calculations
-
Transaction 2 reading from Disk A
-
Transaction 3 writing to Disk B
-
All happen together = better performance
2. Reduced Waiting Time
Serial Execution: Customer orders must wait for previous order to complete entirely Concurrent Execution: Multiple orders processed together
Concurrency Problems
Lost Update Problem
Example: Two people booking last concert ticket
Person A reads: "1 ticket available" ✓
Person B reads: "1 ticket available" ✓
Person A books: "0 tickets left" ✓
Person B books: "0 tickets left" ✓
Result: 2 people think they have the ticket!
Inconsistent Analysis Problem
Example: Bank calculating total money while transfer happening
A = ₹1000, B = ₹2000, Total = ₹3000
Transfer starts: A becomes ₹950 (B still ₹2000)
Bank calculates: A + B = ₹950 + ₹2000 = ₹2950
Transfer completes: B becomes ₹2050
Actual total: ₹950 + ₹2050 = ₹3000
But bank recorded wrong total!