Redis: Awesome in-memory key-value distributed CAP compliant store
Use Cases and Deployment Scope
- Low latency: As it is in memory, saves on I/O
- Repetitive: As part of ETL we use it to address resolution, .i.e. given an address, find a representative lat long for it. As millions of rows are ETLed every day, there is high chance that they repeat. Having in-memory helps again
- Point queries: WHERE age BETWEEN 10 and 30 is a range query and WHERE age = 15 is a point query. We use it only for point queries
Pros
- When dataset is small enough to fit in-memory and get full benefits of reduced I/O
- Need of rich data structures for complex querying
- Speed of in-memory store and durability by disk at the same time
Cons
- Declarative querying like SQL
- Tools for monitoring and identifying performance bottlenecks
- Key schema design can be tricky and heavily impacts the performance (leading to key scans)
Likelihood to Recommend
- Low latency queries are a must
- Frequent point queries as it is a key-value store
- Use awesome Redis Modules (Redis Search, Redis Neural Net, Redis ML, Redis-Secondary, Redis Graph)
- When values are complex objects and not simple data structures. Document stores are better for those work loads
- Huge data and not feasible (due to budget constraints) to scale up RAM
