Database questions are data-contract questions: which queries must be fast, which transactions must be atomic, how large can data grow, and what consistency can clients observe?
Relational availability is not read scaling
RDS Multi-AZ maintains a synchronous standby for failover. It is not normally a read target. Read replicas scale reads asynchronously and can promote, but are not the same automatic-HA contract. Aurora separates distributed storage from compute, exposes writer and reader endpoints, and supports replicas, Serverless, and Global Database patterns.
RDS Proxy pools connections and protects a relational database from bursts such as Lambda concurrency. It does not cache query results.
DynamoDB starts with access patterns
DynamoDB provides key-value/document access with partition and sort keys. On-demand capacity fits uncertain traffic; provisioned capacity fits predictable traffic with active management. GSI adds a new partition-key access pattern and has separate capacity implications; LSI shares the base partition key and must be defined at table creation.
Global Tables provide multi-Region active-active replication. DAX caches DynamoDB reads. DynamoDB Streams records item changes for event-driven processing.
Cache and purpose-built stores
ElastiCache Redis supports richer data structures, replication, persistence options, and sorted sets; Memcached is simpler distributed caching. A cache improves latency and load but creates invalidation and staleness decisions.
Use DocumentDB for MongoDB-compatible document workloads, Neptune for graph relationships, Keyspaces for Cassandra-compatible wide columns, and Timestream for time-series data. “Compatible” does not mean identical to the upstream database.
Exam lens: pick the data model first. Then add availability, read scaling, caching, and global replication as separate requirements.
Review card
- Multi-AZ is HA; read replica is read scaling.
- RDS Proxy pools connections; ElastiCache caches data.
- DynamoDB design begins with partition keys and access patterns.
- DAX is specifically a DynamoDB cache.
- Purpose-built databases win when the query model is genuinely specialized.
資料庫題其實是 data contract:哪些 query 要快、哪些 transaction 要 atomic、資料會長多大、client 允許看到什麼 consistency?
Relational availability 不是 read scaling
RDS Multi-AZ 以 synchronous standby 做 failover,通常不是 read target。Read replica 用 asynchronous replication 擴讀,也能 promote,但不是同一種 automatic-HA contract。Aurora 將 distributed storage 與 compute 分離,提供 writer/reader endpoints,並支援 replica、Serverless、Global Database pattern。
RDS Proxy 做 connection pooling,避免 Lambda concurrency 等 burst 壓垮 relational database;它不 cache query result。
DynamoDB 從 access pattern 開始
DynamoDB 以 partition/sort key 提供 key-value/document access。Traffic 難預測用 on-demand;可預測且願意管 capacity 用 provisioned。GSI 增加新 partition-key access pattern,有自己的 capacity 影響;LSI 與 base table 共用 partition key,且建 table 時就要定義。
Global Tables 是 Multi-Region active-active。DAX cache DynamoDB read。DynamoDB Streams 記錄 item change 供 event processing。
Cache 與 purpose-built store
ElastiCache Redis 有更豐富 data structure、replication、persistence option 與 sorted set;Memcached 是較簡單 distributed cache。Cache 降 latency/load,但會帶來 invalidation 與 staleness 決策。
DocumentDB 對 MongoDB-compatible document workload;Neptune 對 graph;Keyspaces 對 Cassandra-compatible wide column;Timestream 對 time series。Compatible 不代表與 upstream 完全一樣。
考試視角: 先選 data model,再把 availability、read scaling、caching、global replication 當成四個獍立需求。
複習卡
- Multi-AZ 是 HA;read replica 是 read scaling。
- RDS Proxy pool connection;ElastiCache cache data。
- DynamoDB 從 partition key 與 access pattern 設計。
- DAX 專門 cache DynamoDB。
- Query model 真的特殊時才選 purpose-built database。