Spring Data MongoDB & Redis
The document and key-value modules: MongoDB mapping, templates and aggregation, Redis templates and repositories, Redis as a cache and message bus, and reactive Mongo. Interviewers pick from here when the system design involves something other than a relational store.
part ofSpring Frameworkoverview, primer and where to startread it →on this pageshowhide
explore
- MongoDB Document Mapping5 questions
- MongoTemplate & Aggregation5 questions
- MongoRepository5 questions
- RedisTemplate & Redis Repositories5 questions
- Redis as Cache & Pub/Sub5 questions
- Reactive MongoDB6 questions
questions
page 2 of 2When would you choose RedisTemplate over @RedisHash repositories, and what architectural tradeoffs drive that decision?
level: principalimportance: nice to knowfreq 25%
basics
~20 sUse RedisTemplate when you need control over the actual Redis structures — counters, queues, sorted sets, atomic ops, pub/sub, or custom keys. Use @RedisHash repositories for simple id-keyed aggregates with a JPA-like API and a few indexed lookups.
showing 31–31 of 31