2 Comments
May 9Liked by Saurabh Dashora

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
author

It's a great example Akos.

Libraries can have a big impact on how we end up building our application. Stateless may sound complicated at first, but it has more advantages in the long run.

Expand full comment