Zum Inhalt springen
#0799
ExecSqlite

The cache is a Map that survives the request

Every request to your API needs the tenant's config: plan, limits, feature flags. In worker mode, the shared object survives from one request to the next: load the config once, read it from memory forever after. On container restart, the documented pattern is one query: rebuild shared from a SQLite file on the container's disk, then serve from memory again.

On fresh-VM platforms, every byte of remembered state lives somewhere else: a cache service, a key-value store, a connection to manage. The function can't remember, so you rent something that can.

Here the cache is a Map, and the warm path is a property lookup.

State stopped being a service you rent and became a variable.