Anshul Bharat
Software Engineer
Blog
Writing on systems, concurrency, distributed architecture, and API design.
System Design
System Design: URL Shortener (bit.ly)
Designing a URL shortener that handles billions of redirects — hash generation, collision handling, caching, and database choices.
System Design: Twitter / Instagram Feed
How social feeds are generated at scale — the fanout-on-write vs fanout-on-read trade-off, feed ranking, and celebrity user handling.
System Design: WhatsApp — Real-time Chat with Online/Offline
How WhatsApp handles 100 billion messages per day — WebSocket connections, message delivery guarantees, offline queuing, and presence.
System Design: Uber — Real-time Location Tracking and Matching
How Uber tracks millions of drivers in real-time, indexes their locations spatially, and matches riders to the nearest available driver.
System Design: Photo Sharing — CDN, Image Processing, and Feed Ranking
How Instagram-style photo sharing works under the hood — upload pipeline, image processing, CDN distribution, and ML-based feed ranking.
System Design: YouTube — Video Upload and Transcoding Pipeline
How YouTube converts a single raw video upload into dozens of optimized formats and resolutions — the transcoding pipeline, adaptive streaming, and global delivery.
Deep Dives
Semaphores: The Traffic Light of Concurrency
What a semaphore actually is, when to use it over a mutex, and how it prevents resource exhaustion in real systems.
Arc vs Mutex in Rust: What They Do and When You Need Both
Arc and Mutex solve two completely different problems — but you almost always need them together. Here's why.
Redis vs Kafka vs NATS vs RabbitMQ: Picking the Right Broker
Four messaging systems, four different trade-offs. Here's the mental model I use to pick the right one for a given problem.
gRPC: What It Is, How It Works, and When to Use It
gRPC is not just 'faster REST'. It's a fundamentally different contract-first RPC framework with real trade-offs worth understanding.
GraphQL vs REST vs SOAP: Choosing the Right API Paradigm
Three API paradigms with very different philosophies. Here's when each one is the right tool and why copying the wrong one leads to pain.