Developer documentation

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.

UnderstandConceptsHow a read travels L1 → L2 → source, the two kinds of region, what a snapshot is, what happens when something fails. BuildDeveloper guideSubclass 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).

Access & stitchAbstractDacCache, DacGateway, DacPolicy, @Stitch, @DacAuthorize, @CastAuthContext — decide what the caller may see, and hand it to them as a method parameter.
Data plane — the facadeAbstractCache, 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 plane — the enginecache-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.

modulewhat it gives youwhen you need it
cache-starterOne dependency that pulls in the three modules below.Always — this is what an application adds.
cache-coreThe cache plane (engine) plus the data-plane and DAC contracts (AbstractCache, AbstractDacCache, DacPolicy, @Stitch).Pulled in by the starter.
cache-binding-springSpring wiring: SpringCacheSupport, domain flags, Hibernate write bindings, CacheFreshness, the @Stitch advisor and MVC/WebFlux argument resolvers.Pulled in by the starter.
cache-masterdata-starterScans @MasterDataRegion records, preloads them and exposes the refresh endpoints.Pulled in by the starter; used by static regions.
cache-snapshot-processorCompile-time generation of <Entity>Snapshot records and their BINDING from @CacheSnapshot.Add as a provided annotation processor.
cache-domain-castThe CAST domain plugin: six shared regions, CastDacGateway, @CastAuthContext.Applications that read CAST user data.
dac-initializerThis 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.

partsupported baselinewhat this means
Java / JDK25Build and run with JDK 25. AbstractDacCache uses ScopedValue.
Spring Boot4.0.6Every DAC module is built and tested against it.
Spring Framework / Spring Datamanaged by Spring Boot 4.0.6Keep Boot's dependency management; do not override these separately.
Hibernate write bindingHibernate ORM managed by BootNormal JPA inserts, updates and deletes are observed automatically. Bulk JPQL or native SQL needs an explicit CacheFreshness call.
Redis / ValkeyRedis-compatible; examples use Valkey 8.0Connected through Spring Data Redis and Lettuce.
Important

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

Tip

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.