Discussion about this post

User's avatar
Akos Komuves's avatar

This was great, Saurabh! One thing I can think of to push people more in the stateless direction is exactly what some libraries are doing.

For example, express-session, a simple session middleware for express, states in the Readme that the default implementation is an in-memory story that doesn't scale past a single process, and you want to save your session data in the db in production. This is how I learned many years ago about stateless design and how to spin up multiple servers to serve users.

Stateful is suitable for development purposes, but we went stateless even for apps where we only had a single instance because it wasn't more complicated. However, it offered the benefits of scaling horizontally if we had to.

Expand full comment
1 more comment...

No posts