skip to content

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 pageshow

explore

questions

page 2 of 2

When would you choose RedisTemplate over @RedisHash repositories, and what architectural tradeoffs drive that decision?

level: principalimportance: nice to knowfreq 25%

basics

~20 s

Use 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.

open as a page

showing 31–31 of 31