Writing
What I learned taking things apart, written down so I can find it again.
Redis from First Principles, Part 5: a TTL isn't a scheduled deletion
Millions of expiring keys can't mean millions of timers. Redis expires keys lazily on access and sweeps the leftovers with random sampling.
5 Aug 2026 · 3 min
Redis from First Principles, Part 4: one thread, thousands of clients
Don't poll a thousand sockets, ask the OS which three are ready. I/O multiplexing, and why single-threaded is the design, not the compromise.
25 Jul 2026 · 3 min
Redis from First Principles, Part 3: where does half a command live?
Blocking on one slow client freezes them all. Every connection owns a buffer, because a connection isn't just a socket, it's also state.
17 Jul 2026 · 3 min
Redis from First Principles, Part 2: why Redis speaks RESP
You can't split a byte stream on spaces or newlines. RESP makes every value say how long it is, so the question becomes: have I received enough bytes yet?
11 Jul 2026 · 3 min
Redis from First Principles, Part 1: TCP is a byte stream, not a message stream
How many recv() calls does it take to read SET name Shubham? TCP doesn't care. The first bug in my Redis server wasn't a Redis bug at all.
7 Jul 2026 · 3 min
Designing Auth From Scratch: The System Design Interview You Can Actually Answer End-to-End
From a naive login form to argon2id, rotating refresh tokens, MFA, RBAC and horizontal scale. Every decision mapped to the attack it stops.
25 Jun 2026 · 17 min
WebSockets are the easy part: what I learned deep-diving into CRDTs and Yjs
OT is smart functions over dumb data; CRDTs are dumb merge over smart data. Tombstones, offline edits and why the Yjs server is a dumb pipe with memory.
30 May 2026 · 4 min
Node.js: Multi-Threaded or Single-Threaded
One thread runs your JavaScript, the OS does the I/O in the background, and the cluster module spreads the load across cores.
1 Jun 2023 · 3 min
Understanding Model-View-Controller (MVC) Architecture with Express(Nodejs)
A beginner-friendly walk through models, views and controllers in an Express app, with React as the view layer.
31 May 2023 · 3 min
Building Web Servers with Node.js: A Beginner’s Guide
From a bare http server to routing, static files, middleware and error handling, with Express where it helps.
31 May 2023 · 4 min