Java NoSQL and caching
When a relational database is the wrong tool, and what a cache costs you in exchange for speed.
3 concepts · 7 interview questions
What this topic covers
Every concept in nosql and caching, and the questions each one gets asked as. Where a question links, it has a full write-up.
Choosing a data store
Document, key-value, wide-column and graph stores each trade query flexibility for a specific access pattern.
- When would you not use a relational database?
- What does CAP actually say, and what does it not?
Caching patterns
Cache-aside, read-through and write-through, each with different staleness and failure behaviour.
- What caching pattern would you use, and how do you invalidate?
- What is a cache stampede, and how do you prevent it?
- What breaks when the cache and the database disagree?
Consistency models
Strong consistency costs coordination; eventual consistency costs application complexity that has to be handled somewhere.
- How do you choose between strong and eventual consistency?
- What does read-your-own-writes mean, and why do users notice?