Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
From One Server to Millions of Users: Vertical and Horizontal Scaling and the Stateless Tier
The precondition for scaling the application tier horizontally is being stateless: session, the Data Protection key ring, IMemoryCache, local files and scheduled jobs must move outside the instance. In a real two-instance experiment moving session to Redis alone fixes nothing, because session and authentication cookies are encrypted with Data Protection keys; once the key ring is shared too and SetApplicationName is set, the two servers behave like one application.
Back-of-the-Envelope Estimation: QPS, Storage, Bandwidth and Availability Math
Back-of-the-envelope estimation is a short chain of calculations from DAU to average and peak QPS, and from there to storage, bandwidth and availability, that gets the order of magnitude right. For a URL shortener with 10 million DAU, ~1,700 peak QPS and ~1 TB over 5 years fit one database, while 55.6 Gbps of egress makes a CDN mandatory for a photo app; 99.9% means 8.76 hours of downtime a year, and availability multiplies across serial components.
What Is System Design and How Do You Approach It? A 4-Step Method from Requirements to Deep Dive
You approach system design in four steps: clarify requirements and scope, draw a high-level design and get buy-in, deep dive into the component that carries the problem, then state the trade-offs and wrap up. In the Bookstore campaign day example, Little's law (L = λ × W) shows on paper that the bottleneck is the connection pool, not the CPU, and real SqlClient output confirms it.