Last updated: 2026-07-21
Database
- Sharding
- vertical sharding
- horizontal sharding
- Consistent Hashing
- minimize data migration
- Virtual node
- Consistent Hashing
- to prevent single point failure
- Replica
- SQL - master (write) - slave(read, sync)
- NoSQL - 3 virtual node
- Single Point Failure
SQL vs NoSQL
- SQL
- structured data
- multi-indexing
- transaction
- NoSQL
- distribution, parallel computing
- auto-scale
- replica
NoSQL Databases
- Hard drive based
- Cassandra
- MongoDB
- Memory based
- Redis
- Memecached
- no data persistency
- Cloud
- Dynamo DB
- Couchbase
Cache
Use memory based DB such as Memecached is a common choice
Cache Techniques
- Cache Models
- LRU Cache, LFU Cache
- best practice: db.set(), cache.delete()
- db fails more frequently
- have problem in multi-process
- Cache Model
- Cache Aside
- Cache Through
- Thundering Herd
- Dirty Data problem