How it works · Configuration

Ask for a key; the request decides the value

Code asks cconfig for a key of a module and never says which tenant or experiment it serves. The answer is merged from defaults on the classpath, tenant and trajectory files, rows changed at run time and the environment, in a fixed order where later sources win.

cconfig: one value, shaped by tenant and trajectory A service asks cconfig for a key of a module. The client takes the tenant and trajectory from the request context and checks a cache keyed by module, tenant and trajectory. On a miss it runs five retrievers in order: layered classpath JSON deep-merged from base, tenant, trajectory and tenant-trajectory folders; database rows that replace a key or one path inside it; layered properties files; message bundles; and environment variables. The merged result is cached and returned. PricingServicevalue("pricing", "discount") ContextContainertenant acme · trajectory exp1 CconfigClientmerges every source MemoryCache · 5 minpricing | acme | exp1 cconfig-orch.xml: later sources win JSON filesjson-based-cconfig-retrieverdatabase rowsdb-based-cconfig-retrieverproperties filesproperties-based-cconfig-retrievermessage bundlesmessage-bundle-config-retrieverenvironmentenv-based-cconfig-retriever classpath · org/chenile/config 1 pricing.json 2 acme/pricing.json 3 exp1/pricing.json 4 acme/exp1/pricing.json table cconfig pricing · discount · cap = 150 acme · __GLOBAL__ trajectory environmentacme_pricing_discount result cached by module + tenant + trajectory
request
cache
view
Step 1

Exchange

Payload

Layers, not copies

A tenant or trajectory file holds only what differs. Objects merge key by key, so a module is never duplicated per tenant.

Change it while running

A database row replaces a key or one path inside it for everyone, one tenant or one trajectory. It shows up when the cached entry expires, five minutes by default.

Code that does not know

The tenant and trajectory come from the request context, so the same call returns different values in different requests without a parameter.