Skip to content

Stateless Backend

Context

The storage of data should be clearly specified. This helps with understanding the system.

Decision Drivers

  • Simplify scalability
    The backend can be scaled arbitrarily due to its stateless nature. The bottleneck will then only be the database, which, depending on the technology used, can also scale very effectively.
  • Single source of truth (database)
  • No complicated caching mechanisms (e.g., cache invalidation)
  • Client contains its own session

Decision

To achieve a stateless backend, the following rules must be adhered to:

  • No data caches in the backend application(s)
  • Use of the REST approach
    [quote, Roy Thomas Fielding, REST]
    Each request from client to server must contain all of the information necessary to understand the request, and cannot take advantage of any stored context on the server. Session state is therefore kept entirely on the client.

Consequences

None known

Built with ❤️ in Switzerland 🇨🇭