Write reaches the backend
INSERT, UPDATE, DELETE, and DDL operations are not served from a cache result.
Architecture in practice
CacheDB is inserted into the database request path. Its mode, policy, metadata, and invalidation decisions determine when a result may be reused and when a request must return to the backend.
Request flow
The backend database remains the source of truth. Redis is the shared cache and control plane; the proxy makes the decision for each eligible request.
The client connects through a selected CacheDB protocol path.
CacheDB identifies the statement, tables, parameters, transaction state, and policy context.
For an eligible read in full mode, it derives a key and checks Redis.
A hit returns the stored response. A miss reaches the backend, whose successful response can be stored for later reuse.
Write path
Write operations go to the backend. After completion, CacheDB can use parsed metadata and policy to invalidate cache entries related to the tables that changed.
INSERT, UPDATE, DELETE, and DDL operations are not served from a cache result.
Rhai hooks can inspect directly written tables and, when safe, use more specific conditions.
When predicate metadata is incomplete, invalidate the written-table scope rather than guessing.
Deployment mode
Transparent
CacheDB parses requests and records metadata, monitoring, and metrics, but does not serve or store cached query results. Use it to validate compatibility and baseline behavior.
Full
Eligible reads can use Redis-backed results. Full mode requires valid licensing and a workload-specific policy for TTL, bypass, and invalidation.
Boundaries and degraded behavior
CacheDB 1.9 documents eventual consistency for cached reads. It should not be used for strict state such as locks, sessions, feature flags, or other data that must always be read from the backend.
Its transport model is explicit: native proxy and Redis connections do not provide TLS. Put the proxy, backend, and Redis on a trusted private network or add network-layer encryption and edge controls.
Read cache behavior and consistencyRead security boundariesA controlled evaluation
Use transparent mode and a representative workload to establish a baseline, then agree the policy and measurements for an evidence-led full-cache test.