3.0 Storage and Retrieval
-
색인의 방식에 따라 다음 두가지로 나뉨
- log structured storage engine
- Page-oriented storage engine
- Other indexing structures
3.1 Data Structures That Power your Database
- db_set
- Db_get : full table scan O(n) => 색인의 필요성
- 색인 (index)
3.1.1 Hash Indexes
- conventional 한 느낌?
3.1.2 Log Structured Storage Engine : SSTables and LSM-Trees
- Sorted String Table : merge-sort 느낌, (figure 3-4) , 사전에서 handbag을 찾는다면 h로 먼저가서 찾음, 처음부터 하나씩 볼 필요가 없음
- Log-Structured Merge Tree
3.1.3 Page oriented storage engine : B-Trees
3.1.4 Comparing B-Trees and LSM-Trees
- LSM은 쓰기가 빠르고 Btree는 읽기가 빠름
3.1.5 Other Indexing Structures
-
storing values within the index
-
multi-column indices
-
Full-text search and fuzzy indices
-
keeping everything in memory
3.2 Transaction Processing or Analytics
3.3 Column-Oriented Storage
- Base
3.4 Summary
- In this chapter we tried to get to the bottom of how database handle storage and retrieval.
- we saw that storage engine fall into twh broad categories:
- OLTP (optimized for transaction processing)
- OLAP (optimized for analytics)