Stateless vs stateful
A stateless system keeps no trace of what came before: every request starts from scratch. A stateful system remembers (login session, cart, conversation history). The distinction drives six architecture pairs every AI builder ends up having to call: Lambda versus ECS (one-off task triggered on demand versus a service that keeps running), database versus cache (durable storage versus a fast temporary copy), queue versus stream (a list you clear once handled versus an event timeline you can replay), retrieval versus reranking (finding a batch of documents versus pushing the best ones to the top), monitoring versus tracing (knowing something is wrong versus following one request to find where).
Strengths
- A single reading axis that orders six architecture decisions instead of handling them one by one
- The stateless-by-default reflex avoids the most common scalability debt
Limitations
- The distinction is binary in theory but blurry in practice: many systems are stateful only in places
Best for
- A dev or tech lead laying the foundations of an AI backend who wants to avoid paying for a naive architecture later