Build a Session-Backed Shopping Cart with Redis and Node.js

In this post, I will discuss session management with Redis in a rudimentary way. Before you begin, please install the following. redis-cli node.js I am going to create an app that will use a redis server to perform session management tasks. I want to focus on session management in this demo which is why we will assume that on login the auth takes place in the background somehow. The reason why we use Redis for session management is because it is super-fast as it stores data in memory. ...

October 7, 2026 · 6 min · Muhammad Ali

Server-Side Caching Explained: Cache Hit, Miss, and Expiry

Server side caching can be implemented via reverse proxy such as nginx. Caching allows the traffic to be served faster and also reduces the load on the app. In this post, I am going to demonstrate the server-side caching using a server and an nginx reverse proxy running locally. Lets talk about what cache miss and cache hit mean. Cache Miss This is when a reverse proxy receives a request and can’t find the response in the cache. In such cases, the request is forwarded to the origin server and reverse proxy stores the response in cache. ...

October 6, 2026 · 4 min · Muhammad Ali

Nginx Rate Limiting in Action

Rate limiting an API is required for several reasons. A single service serves calls from many clients. We want to make sure that the calls from clients are served fairly and one client doesn’t consume all the app resources. Too many requests in a short period of time can overwhelm the service by consuming too much CPU or memory. Another reason why we might want to limit a client is when they used up all their allocated credits. ...

October 4, 2026 · 4 min · Muhammad Ali

Canary Deployments, Weighted Round Robin and Stickiness

Lets test a canary deployment using nginx weighted round robin strategy. Canary deployment is a pattern where a new version of a service is rolled out to a subset of users to make sure that the new version works as intended. Lets say we have an exisiting deployment and we would like to route about 20% of the requests to a canary while the existing deployment gets 80% of the requests. We can specify the weights in the nginx reverse proxy config. See highlighted lines below. ...

October 1, 2026 · 3 min · Muhammad Ali

Round Robin with nginx

This is a simple demo of a round robin reverse proxy. Round robin is a fundamental concept in system design. I will show how this concept can be demonstrated locally. I am going to create three http servers locally on Ubuntu. I will then put nginx reverse proxy in front of the servers and we will see how the reverse proxy routes the traffic. Lets fire up a terminal multiplexer. We will have four sessions here. I will run three servers in three separate panes ...

September 29, 2026 · 2 min · Muhammad Ali