Keep Application State Local
Avoid a network hop to a separate cache for data used by one workload. Attach a sidecar and connect through localhost or a Unix socket.
Use this shape for compiled templates, computed responses, and other rebuildable working data. Set expirations where stale entries are no longer useful, and keep a refill path for eviction or replacement.
A workload-specific key prefix helps organize data, but it does not enforce locality. Other nodes that access those keys can subscribe to them. Use separate instances or cluster identities when state must be isolated.
Local and distributed keys explains when first reads and shared operations involve the network. Add selected shared state when another workload needs the same value.