<aside> 🔐

Stateless Identity in Microservices

AuthN vs AuthZ, JWT, and the evolution to fine‑grained authorization (PDP/PEP)

</aside>

<aside> ⚡

Read time

~8–10 minutes

</aside>

<aside> 🧭

Audience

Architects + senior engineers shipping distributed systems

</aside>

<aside> 🎯

Goal

Design identity & authorization that scales without central session state

</aside>


0) Executive summary (the 30‑second version)


1) The paradigm shift: sessions → stateless tokens

<aside> 🏗️

A microservice architecture wants horizontal scaling and failure isolation. That’s incompatible with a single, central session store on the critical path of every request.

</aside>

Why stateful sessions become a bottleneck

What “stateless” actually means (and doesn’t)

Term Meaning Common misconception
Stateless API Each request is independently verifiable and carries required context (token). “No state exists anywhere.” (State still exists in DBs, caches, policy stores.)
Stateless auth No per-session server storage needed to authenticate a request. “Logout/revocation is free.” (It’s not.)

2) AuthN vs AuthZ (crisp separation)