Chapter 9 KV Store
Refer:
https://soulmachine.gitbooks.io/system-design/content/cn/key-value-store.html (github: https://github.com/henrywoo/system-design)
Industry Examples:
- DynamoDB: https://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf
- S3
- BigTable/HBase/Hypertable
- Cassandra
- Redis
- Memcached
9.3 LSM-Tree
Sequential Write ==> Sorted String Table
Hashing: Hash from key
to offset in log file
! Not key to value.
Compaction: throw duplicated key in the log and keep the latest version of record.
Bloom filter
9.5 Eviction
9.5.1 LRU
http://sde.quant365.com/augmented-data-structure.html#lru-cache
list.emplace_front()
, list.erase()
, list.pop_back()
, list.back()
, list.splice()
https://www.geeksforgeeks.org/list-splice-function-in-c-stl/
map.at()
, map.erase()
Java:
LinkedHashMap
https://www.geeksforgeeks.org/linkedhashmap-removeeldestentry-method-in-java/
9.5.2 LFU
http://sde.quant365.com/augmented-data-structure.html#lfu-cache
list.emplace()
Java:
LinkedHashSet