03 - Storage and Retrieval

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

  • Hiểu database storage engine ở mức data structure: hash indexes, SSTables/LSM-trees, B-trees.
  • Phân biệt workload OLTP và OLAP.
  • Nắm column-oriented storage và vì sao nó hợp analytics.

Định nghĩa quan trọng

  • Hash index:
  • SSTable:
  • LSM-tree:
  • B-tree:
  • OLTP:
  • OLAP:
  • Column-oriented storage:

Mental model

Write/read pattern
-> chọn index/storage structure
-> ảnh hưởng write amplification, read amplification, compaction, range query
-> quyết định engine hợp transaction hay analytics

Concept cần nối

Câu hỏi review

  • LSM-tree đổi write performance lấy chi phí gì?
  • B-tree mạnh ở kiểu truy vấn nào?
  • Vì sao column storage nén tốt và đọc nhanh cho analytics?

Liên kết