Skip to content
Javers docs0.2

Persistence selection guide

Latest stable Based on Javers release 0.2.1

Pick a repository by the question it must answer after a failure, not by latency alone.

Persistence decision map

ConcernExposedRedisKafka repository
Primary roledurable SQL audit historyRedis-backed snapshot historysnapshot publication stream
Query shapeJaVers queries, implemented partly by in-memory filteringJaVers queries after scanning Redis keys/listsno reads; methods return empty/default
Orderingsnapshot version plus stored commit sequencelist order plus stored commit sequenceproducer/partition ordering only; no repository reads
Replaydatabase restore/query, not an event replay enginerestore from Redis persistence or rebuild externallyconsumers may replay retained records if configured
Cache behaviornone in the adapterRedis is the repository, not a near-cachenone
Recovery ownerdatabase/schema operatorRedis persistence/backup ownerKafka producer, topic, consumer, and projection owners

Use Exposed when audit history must survive process restart and fit database operations. Use Redis when Redis is an accepted snapshot store and the team owns its durability configuration. Use Kafka only when publishing encoded snapshots is the goal and another system owns consumption and query state.

None of these adapters promises exactly-once end-to-end behavior. Exposed operations use separate transactions, Redis updates cover several structures, and Kafka waits up to 30 seconds for a send result. Plan retry and reconciliation around identifiers such as GlobalId, snapshot version, commit ID, aggregate ID, and consumer offset.

For mixed designs, read repository composition and failure contracts.