TLDR: Decoding Isolation - The I in ACID
Date: 2021-07-07 Source: https://arpitbhayani.me/blogs/isolation
Overview
Dive into database isolation! Understand its importance in maintaining data integrity during concurrent transactions with real-world examples. After talking about the “A” and the “C” in ACID, let’s talk about the “I” in ACID - Isolation.
Key Points
- After talking about the “A” and the “C” in ACID, let’s talk about the “I” in ACID - Isolation.
- Example 1: Cowin Portal: When 500 slots open for a hospital, the system has to ensure that a max of 500 people can book their slots.
- Example 2: Flash Sale: When Xiaomi conducts a flash sale with 100k units, the system has to ensure that orders of a max of 100k units are placed.
- Example 3: Flight Booking: If a flight has a seating capacity of 130, the airlines cannot have a system that allows ticket booking of more than that.
- Example 4: Money transfers: When two or more transfers happen on the same account simultaneously, the system has to ensure that the end state is consistent with no mismatch of the amount.