Mark As Completed Discussion

Transactions

The best way to start looking at this question is through a prism of transactions - atomic operations performed over data. Transactions have the following properties: Atomicity, Consistency, Isolation and Durability. These properties allow us to reason about the correctness of our storage layer design. Understanding the following is of highest importance:

  • Atomicity means an all or nothing approach to a transaction. Think of a money transfer - we want this operation to complete in full: Money deducted from the source account and added to the destination account. If this operation is interrupted by a power outage we want this operation to either be completed in full or rolled back.
  • Consistency means that system goes from one consistent state to another consistent state. An operation should not leave the system in an inconsistent state.
  • Isolation transactions that execute in parallel must not interfere with each other.
  • Durability once operation is executed it remains durable across restarts.