DAC Cache
A caching library for Spring Boot services: an optional near cache in every pod, one shared Redis or Valkey behind them, and a data plane that turns "cache this" into one subclass and one annotation — with entitlement checks and parameter injection on top.
AbstractCache, generate snapshots, guard data with AbstractDacCache, inject with @Stitch.
RunOperationsEvery dac.* property, Helm and Octopus wiring, leader election, refresh, metrics and Valkey installation.
Introduction
DAC Cache is a library, not a service. It is added to a Spring Boot application as one dependency and makes the application's reads faster without changing where the data lives: the database or external system stays the source of truth, and every cached value can be thrown away and rebuilt.
The library has three layers. Each layer only adds packaging on top of the one below — none of them introduces new cache semantics, which is what keeps the behaviour predictable. You will meet two names again and again: the data plane (the facade classes your application touches) and the cache plane (the engine that moves bytes between tiers).
AbstractDacCache, DacGateway, DacPolicy, @Stitch, @DacAuthorize, @CastAuthContext — decide what the caller may see, and hand it to them as a method parameter.AbstractCache, RegionBinding, CacheSupport, @CacheSnapshot — describe a region once, read it through one typed class, with cache-plane-off fallback, domain flags and transaction guards built in.cache-core — regions, an optional near cache (L1 Caffeine) + L2 Redis/Valkey, versioned static snapshots, secondary indexes, cross-pod invalidation, leader election, write-behind, refresh events, cluster broadcast, metrics.The library caches two kinds of data, and keeps the distinction explicit: data your application owns (its own database tables — the source of truth is yours), and data of an external application you only read over an API (PDI, PAS, IDM, LDAP…). Caching external data is optional — an opt-in region behind a flag, exactly how indc-core caches its PDI and PAS lookups. Concepts — whose data is it spells out what changes between the two.
Modules
All modules share the Maven group com.juliusbaer.dac and live under dac/
in the client-notification-handler repository.
| module | what it gives you | when you need it |
|---|---|---|
| cache-starter | One dependency that pulls in the three modules below. | Always — this is what an application adds. |
| cache-core | The cache plane (engine) plus the data-plane and DAC contracts (AbstractCache, AbstractDacCache, DacPolicy, @Stitch). | Pulled in by the starter. |
| cache-binding-spring | Spring wiring: SpringCacheSupport, domain flags, Hibernate write bindings, CacheFreshness, the @Stitch advisor and MVC/WebFlux argument resolvers. | Pulled in by the starter. |
| cache-masterdata-starter | Scans @MasterDataRegion records, preloads them and exposes the refresh endpoints. | Pulled in by the starter; used by static regions. |
| cache-snapshot-processor | Compile-time generation of <Entity>Snapshot records and their BINDING from @CacheSnapshot. | Add as a provided annotation processor. |
| cache-domain-cast | The CAST domain plugin: six shared regions, CastDacGateway, @CastAuthContext. | Applications that read CAST user data. |
| dac-initializer | This documentation and a runnable demo of every behaviour. | Learning and demos. |
Supported baseline
The current release has one tested baseline. Use these versions unless the library is updated and tested with another combination.
| part | supported baseline | what this means |
|---|---|---|
| Java / JDK | 25 | Build and run with JDK 25. AbstractDacCache uses ScopedValue. |
| Spring Boot | 4.0.6 | Every DAC module is built and tested against it. |
| Spring Framework / Spring Data | managed by Spring Boot 4.0.6 | Keep Boot's dependency management; do not override these separately. |
| Hibernate write binding | Hibernate ORM managed by Boot | Normal JPA inserts, updates and deletes are observed automatically. Bulk JPQL or native SQL needs an explicit CacheFreshness call. |
| Redis / Valkey | Redis-compatible; examples use Valkey 8.0 | Connected through Spring Data Redis and Lettuce. |
Spring Boot 3.x and JDK 17/21 are not verified. Treat them as unsupported until a build and test run succeeds.
How this documentation is organised
- Getting started — the four steps that take a service from nothing to cached static data and cached transactional data.
- Concepts — the mental model. Read once; everything else refers back to it.
- Developer guide — one page per feature, each written as concept → minimal code → complete example → rules and reference. Pages build on each other in sidebar order.
- Operations — the property reference and what an operator needs to know to run it.
- Reference — the regions CNH runs today and the complete code examples from the initializer.
- Live initializer — every behaviour on this site can be exercised on the running demo with a live log.
New to the library? Read Getting started and Concepts, then jump to the developer-guide page for the data you want to cache. Already on the cache-plane API (@Bean CacheRegionConfig)? Start at Data plane — the facade — it replaces that boilerplate.