07 - Transactions

Mục tiêu cần hiểu

  • Hiểu ý nghĩa thực tế của ACID.
  • Phân biệt single-object và multi-object transactions.
  • Nắm isolation levels: read committed, snapshot isolation, serializability.

Định nghĩa quan trọng

  • Transaction:
  • ACID:
  • Read committed:
  • Snapshot isolation:
  • Lost update:
  • Write skew:
  • Serializability:
  • Two-phase locking:
  • Serializable snapshot isolation:

Mental model

Nhiều client đọc/ghi đồng thời
-> isolation level quyết định anomaly nào có thể xảy ra
-> stronger guarantee dễ reasoning hơn nhưng tốn chi phí/giảm concurrency

Concept cần nối

Câu hỏi review

  • ACID là guarantee kỹ thuật hay marketing term?
  • Snapshot isolation ngăn được gì và không ngăn được gì?
  • Write skew khác lost update ở đâu?

Liên kết