ADR 003 — cache, database, and CORS¶
Status: Accepted · Date: 2026-08-01
Decision¶
Use a bounded six-hour in-process TTL cache, do not grant the first public API database credentials, and allow wildcard CORS only for anonymous GET/OPTIONS without credentials.
Why¶
The initial registry is immutable source code and the point adapter has no durable spatial-processing requirement. In-process caching reduces USDA load while keeping timestamps explicit and deployment simple. Public CORS is necessary for independent D3 dashboards and static teaching tools; because routes are read-only and credential-free, wildcard origin does not expose private browser authority.
Consequences¶
Cache entries disappear on restart and do not coordinate across instances. The service never serves expired entries after an upstream failure. A future durable cache or area-query service will use PostgreSQL/PostGIS with separate ownership. Any credentialed or mutating API will use an explicit origin allowlist and a different security boundary.