Java Data storage at scale
Choosing a store, and what happens to it when one machine is no longer enough.
4 concepts · 12 interview questions
What this topic covers
Every concept in data storage at scale, and the questions each one gets asked as. Where a question links, it has a full write-up.
Choosing a data store
The access pattern chooses the store, not the other way round. Most systems need more than one, and each addition is an operational cost.
- SQL or NoSQL for this system, and why?
- When would you add a search index rather than query the database?
- What does a time-series or a graph store give you that a relational one does not?
Replication
Copies of the data give read capacity and survive a node loss, and introduce a window where a replica has not caught up.
- What is replication lag, and what breaks because of it?
- Synchronous or asynchronous replication?
- How do you route reads to replicas safely?
Sharding and partitioning
Splitting data across machines when one cannot hold it. The partition key decides the skew, and cross-shard queries decide how much you regret it.
- How would you shard this data, and what key would you choose?
- What is a hot partition, and how do you fix one?
- What becomes hard once data is sharded?
Multiple regions
Serving users from a nearby region cuts latency and forces a decision about where writes happen and what a failover loses.
- What changes when you add a second region?
- Active-active or active-passive?
- What is your RPO and RTO, and how would you meet them?