Skip to content
BENIBIX Learn

Stateless Service

Development🏗️ ArchitectureArchitecture Basics

Also known as Stateless Application, Stateless Server, Stateless Process

A service that keeps nothing between calls. So any copy can answer.

Think of it like

It is like a shop clerk who never knows you. You show your ticket each time.

Example

Jack's shop runs five copies of its web app. Carts live in a shared cache, so the load balancer can send each click to any copy.

Why it matters

Stateless services grow by just adding copies. A crash loses nothing, because nothing lived there.

Definition

A stateless service keeps no memory of past requests inside itself. Each request carries all it needs, like a login token. Anything that must last, such as a cart, is saved in a database or cache outside the service. So any copy of the service can answer any request. That makes it easy to add copies, or to replace one that crashes.
Stateless, on the left: any copy can answer, since the cart is kept in a shared cache.

Common mistake

Saving a user's data in the server's memory or on its own disk. It works with one copy, then breaks when a second copy is added.

Key takeaways

  1. 1
    No memory inside. Each request stands alone.
  2. 2
    State lives outside. In a database or cache.
  3. 3
    Any copy answers. Easy to grow and replace.

Compare