Transaction in database

A transaction is a unit of work that must maintain ACID properties. ACID is an acronym of Atomicity, Consistency, Isolation, and Durability Let’s look at each of them in detail. Atomicity A transaction contains a query or a set of queries. In order to maintain atomicity property, the transaction either has to execute all the …

Read Lock vs Write Lock

A lock is a synchronization primitive which limits access to a shared resource among multiple threads. We don’t need locks when only one thread is running or there is no shared resource because a lock is always acquired on a shared resource. Let’s look at what locks can be acquired. Read Lock Multiple threads can …