DATABASES & STORAGE
12 min read
·
Mechanical Sympathy
Mechanical Sympathy in Storage Engines: B+ Trees vs LSM-Trees
An architectural breakdown of read, write, and space amplification. Explains why LSM-Trees dominate write-intensive workloads through sequential append-only logs and compaction, while B+ Trees excel at point lookups via slotted-page layouts.
JAVA & CONCURRENCY
10 min read
·
JVM Internals
Demystifying Java 21 Loom: Virtual Threads, Monitors & Pinning Traps
Deep dive into Project Loom continuation mechanics, carrier thread unmounting, and why `synchronized` blocks and JNI calls cause carrier thread pinning. Shows migration patterns to `ReentrantLock` and `StructuredTaskScope`.
SYSTEM DESIGN
14 min read
·
Distributed Scale
Distributed Rate Limiting at Scale: Token Buckets vs Sliding Window Logs
How to architect multi-region rate limiters capable of handling 100,000+ RPS. Compares Redis Lua script token buckets against sliding window approximations, addressing race conditions and clock drift.
KERNEL & NETWORKING
15 min read
·
Operating Systems
Linux Zero-Copy & Kernel Internals: Why Kafka and epoll Outperform Traditional I/O
Tracing system calls from disk to socket. Explains how `epoll_wait` uses red-black trees and ready lists to achieve O(1) scaling, and how `sendfile()` eliminates user-space context switches through DMA copy.
SYSTEM DESIGN HLD
11 min read
·
Capacity Math
Scalable URL Shortener Architecture: KGS Key Generation & 5-Year Capacity Math
Complete high-level design walkthrough for TinyURL. Features base62 encoding calculations, Key Generation Service (KGS) pre-allocation, 80/20 caching distribution, and partition strategy for 5-year storage scaling.
DISTRIBUTED CONSENSUS
13 min read
·
Consensus & Raft
Raft Consensus Invariants: Dissecting Leader Election & Log Matching
Understanding why Raft is understandable without sacrificing rigor. Detailed walkthrough of the Election Safety, Leader Append-Only, and State Machine Safety properties.