Stateless Service Design

Making a service instance disposable so replicas are interchangeable: what stateless actually means — no correctness/routing dependency on one instance's volatile history; the in-process state inventory; and session state as a placement decision between sticky routing, an external store and a signed token. Use when replicas is raised above 1, when a @Scheduled job suddenly runs N times, when a local cache disagrees between instances, when an in-memory rate-limit counter or idempotency map is the source of truth, when HttpSession holds anything a user would miss, when a service writes to java.io.tmpdir, or when a rolling deploy loses sessions. Does not cover pod replacement and drain (kubernetes-service-lifecycle), reaching a replica (load-balancing-and-routing), cache design (caching-strategies), fleet-singleton work (leader-election), state split by key (sharding-and-partitioning), pool arithmetic (connection-pool-sizing), or what replicas may observe (consistency-models).

robsonkades Updated

File contents

robsonkades/agent-skills/tree/main/skills/stateless-service-design commit 1bd2c73fcf

Frequently asked questions

npx skillmds@latest add robsonkades/stateless-service-design