
Scalability: Scaling Up vs Scaling Out
My app fell over at 5,000 users and my first instinct was to buy a bigger server. Here's what I learned about vertical vs horizontal scaling and why statelessness is the real unlock.
→Learn the building blocks of designing large-scale systems. From scalability and load balancing to caching, databases, consistency trade-offs, fault tolerance, and the cross-cutting concerns that keep production systems alive. Each post explains the why before the how, with concrete examples and the trade-offs that actually come up in interviews and on the job.
Core ideas that frame every design decision: how systems scale and how we measure them

My app fell over at 5,000 users and my first instinct was to buy a bigger server. Here's what I learned about vertical vs horizontal scaling and why statelessness is the real unlock.
→
My dashboard said average latency was 50ms, and customers were still complaining. Here's what I learned about latency vs throughput, why percentiles beat averages, and how SLAs are actually defined.
→Distributing requests across machines and serving data closer to the user

Once I had ten servers, I had a new problem: how does traffic reach all of them from one URL? Here's what I learned about load balancers, algorithms, L4 vs L7, and health checks.
→
Caching made my app fast and then served stale data to thousands of users. Here's what I learned about cache layers, write strategies, eviction, and why invalidation is genuinely hard.
→Storing data at scale and reasoning about the consistency vs availability trade-off

I picked NoSQL because it sounded scalable, then desperately missed joins. Here's what I learned about SQL vs NoSQL, replication, sharding, and indexing, and how to choose without the hype.
→
I thought CAP meant 'pick two of three.' That framing confused me for years. Here's what the CAP theorem actually says, what consistency models mean, and why PACELC completes the picture.
→Surviving failure and decoupling work with queues and messaging

One slow third-party API took my whole app down with it. Here's what I learned about redundancy, graceful degradation, and the resilience patterns that stop one failure from becoming an outage.
→
My signup endpoint took 8 seconds because it sent the welcome email inline. Here's what I learned about message queues, pub/sub, delivery guarantees, and backpressure.
→How services talk to each other and to clients
Cross-cutting concerns that keep systems healthy in production
Deeper concepts teased or missing from Part 1 — hashing, CDN, idempotency, coordination, multi-region, event patterns

I added a cache node and nearly every key moved at once. Here's why hash(key) % N breaks when you resize, and how consistent hashing keeps resharding from emptying your cache.
→
We turned on a CDN and users in Tokyo still waited on our Virginia origin. Here's what edge caching actually controls — static vs dynamic, TTL, purge, and the mistakes that leak data across users.
→
Retries and at-least-once delivery mean work runs twice. I learned that the hard way when users got double-charged. Here's idempotency keys, the outbox pattern, and why exactly-once is usually a lie.
→
Two app servers both thought they were the leader and ran the nightly batch twice. Here's how leader election and distributed locks work, split-brain, TTL traps, and when to use etcd instead of Redis.
→
We added a second region for latency and woke up to write conflicts. Here's active-active vs active-passive, failover, conflict resolution, and when multi-region is worth the complexity.
→
We overwrote order state in place and lost the trail when finance asked what happened. Here's event sourcing, CQRS, read models, and when the complexity is worth it.
→How to approach any system design problem — requirements, napkin math, diagrams, and trade-offs

I knew caching, sharding, and CAP — and still froze when someone said "design Twitter." Here's the repeatable framework I use for interviews and real design reviews: clarify, scope, estimate, diagram, trade off.
→
We spent a design review on gRPC vs REST before anyone estimated redirect QPS or row size. Napkin math — QPS, storage, bandwidth — belongs before the boxes.
→
My architecture diagram looked polished in the review — until someone asked what happens when the cache dies. Here's how to draw diagrams that reveal trade-offs instead of hiding them.
→Case studies: high read ratio, caching layers, distributed workers

I built a link shortener for a side project and the database melted on redirects. Here's requirements, napkin math, base62 IDs, cache-aside, and the schema that survives read-heavy traffic.
→
My first crawler got IP-banned and crawled the same pages for hours. Here's politeness, URL dedup, a frontier queue, and how to scale workers without melting the target site or your own cluster.
→Case studies: feeds, notifications, chat
Rate limiting, search indexes, stream processing
No posts in this module yet.