Concurrency
In a database system, transactions are executed concurrently
. This means that multiple transactions are executed at the same time.
As several transactions may access the same resource at the same time, concurrent transactions may cause inconsistencies. This is where data may get lost, or remain uncommitted
.
Think in this way: A single transaction executes multiple queries, concurrent transactions would execute numerous queries at the same time! The database is sure to get confused with so many queries executing!
To deal with any possible concurrency issues, databases ensure they have the ACID
properties:
Atomicity
Consistency
Isolation
Durability
In this tutorial, we will focus only on the isolation
property.