46 articles in high level design › engineering internals.
Learn how consistent hashing distributes data across nodes so that adding or removing a node rebalances only 1/N of the keyspace, and why virtual nodes fix the uneven-load problem.
Learn the five ID generation strategies used in production systems, when each breaks, and why Snowflake IDs are the default choice for any distributed write-heavy service.
Understand how the write-ahead log guarantees database durability, what fsync actually costs, and why WAL enables both crash recovery and replication in one mechanism.
Learn how B-tree indexes store and retrieve rows, why column order in composite indexes matters, and what causes index fragmentation at scale.
Learn how Log-Structured Merge trees turn random writes into sequential I/O, what compaction costs, and why Cassandra and RocksDB choose LSM over B-trees for write-heavy workloads.
Learn how Bloom filters answer membership queries in O(1) with zero false negatives, how to size the bit array for your false positive budget, and where Cassandra and RocksDB rely on them.
Learn which Redis data structure to use for timelines, counters, leaderboards, and sessions, with the specific commands and trade-offs each one makes.
Learn why database connection overhead makes per-request connections unusable at scale, how pool sizing directly impacts throughput, and when pool exhaustion cascades into a full outage.
Understand why offset pagination breaks under concurrent writes, and how cursor-based (keyset) pagination delivers stable, consistent pages at any scale.
Compare JSON, Protobuf, Avro, and MessagePack on encoding size, schema evolution, and parse speed, so you can pick the right format for each layer of your system.
Learn how MVCC lets readers and writers proceed without blocking each other by keeping multiple row versions, what vacuum does in PostgreSQL, and why MVCC does not eliminate all lock contention.
Learn the difference between row locks, table locks, and advisory locks, how deadlocks form and are resolved, and why understanding lock granularity prevents the most common write-contention bottlenecks.
Understand how two-phase commit achieves atomicity across multiple databases, why the coordinator is a blocking single point of failure, and what alternatives engineers reach for instead.
Learn what properties make a hash function suitable for databases, consistent hashing rings, and checksums, and why choosing the wrong hash function is a frequent source of unexpected collisions and performance cliffs.
How search engines use inverted indexes to find documents by term in O(1). The data structure behind Elasticsearch, Lucene, and PostgreSQL full-text search, covering posting lists, TF-IDF scoring, and segment merging.
Learn how backpressure prevents fast producers from overwhelming slow consumers, why unbounded queues are not a solution, and how TCP, Kafka, and reactive streams each implement flow control.
Learn how Node.js and nginx serve tens of thousands of concurrent connections on a single thread, what the event loop actually does, and when this model breaks down.
Understand how sendfile and DMA transfer eliminate unnecessary kernel-to-user copies, why Kafka can sustain 1M+ messages per second on commodity hardware, and when zero-copy applies.
Learn how HTTP persistent connections eliminate TCP handshake overhead, what HTTP/2 multiplexing adds on top, and why connection keep-alive settings are a frequent source of production 502 errors.
Learn how DNS resolves a hostname end to end, what recursive vs. iterative resolution means, and why TTL tuning during deployments is as important as the deployment itself.
Learn how JWTs encode claims and signatures, why the none algorithm is a critical vulnerability, and what stateless auth actually trades away compared to session tokens.
How OAuth 2.0 authorization code flow + PKCE works step by step, what OIDC adds on top, token introspection vs. local JWT verification, the JWKS endpoint, and common implementation mistakes.
Learn how gossip protocols propagate cluster state to every node in O(log N) rounds without a central coordinator, and how Cassandra and Consul use it for failure detection and membership.
How the Raft consensus algorithm achieves distributed agreement through leader election, log replication, and safety guarantees, and why it replaced Paxos for most production systems.
How Paxos achieves distributed consensus across unreliable nodes, the Proposer/Acceptor/Learner roles, the two-phase protocol, and why Raft replaced it for most implementations.
The mathematics behind quorum reads and writes in distributed systems: how W + R > N guarantees overlap with the latest write, the latency-consistency tradeoff, and sloppy quorums in Dynamo-style systems.
How vector clocks track causal relationships between events in distributed systems, detecting concurrent writes, resolving conflicts, and why Lamport timestamps alone are insufficient for causality.
How Merkle trees enable efficient data verification and anti-entropy in distributed systems, powering Git's content addressing, BitTorrent's peer verification, and Cassandra's anti-entropy repair.
Learn how skip lists achieve O(log N) search, insert, and delete without rebalancing by layering probabilistic shortcut lanes over a linked list, and why Redis uses them for sorted sets.
How tries provide O(k) key lookup, insertion, and prefix search, powering autocomplete, IP routing tables, DNS resolvers, and dictionary implementations.
Learn how copy-on-write defers expensive data copies until the moment a write actually happens, how Redis uses it for non-blocking snapshotting, and where COW produces surprising memory spikes.
How columnar databases store data by column instead of row, why this is 10-100x faster for analytical queries, and how compression and vectorized execution amplify the advantage, with tradeoffs vs row-oriented storage.
How time series databases store, compress, and query high-rate timestamped data, including delta-of-delta encoding, Gorilla compression, downsampling, and retention policies that power monitoring and IoT systems.
How Kafka stores data in log segments, how the ISR (in-sync replicas) set ensures durability, how consumer group rebalancing works under the hood, and how compacted topics enable stateful consumers.
How gRPC works under the hood: HTTP/2 multiplexing, Protobuf binary framing, the four RPC types (unary/server streaming/client streaming/bidirectional), connection management, and operational tradeoffs vs REST.
How PostgreSQL's query planner chooses execution plans using column statistics and a cost model. What EXPLAIN ANALYZE output means, how to identify bad plans, and how to fix them without rewriting queries.
How TCP prevents network collapse using congestion control algorithms. Slow start, congestion avoidance, AIMD, and why modern algorithms CUBIC and BBR have replaced the original Reno algorithm.
How LZ77, Huffman coding, and their descendants (gzip, zstd, Snappy) compress data, the entropy and redundancy concepts, speed vs ratio tradeoffs, and which algorithm to use for databases, networking, and storage.
How CRC checksums detect data corruption in storage and networking, the math behind polynomial division, when to use which algorithm, and how databases use checksums to catch silent corruption.
How mmap maps file contents directly into virtual memory, enabling zero-copy file access. How databases use it, the OS page cache interaction, and when mmap is faster (and slower) than read/write system calls.
How Linux epoll and BSD kqueue enable a single thread to monitor thousands of file descriptors. The C10K problem epoll solved, how Nginx and Node.js use it, and why event-driven I/O beats thread-per-connection at scale.
How HyperLogLog estimates cardinality (distinct count) using probabilistic hashing. How hash bucketing and harmonic mean estimation work, why it uses only 12KB for any cardinality, and how to merge HLL sketches.
How count-min sketch estimates element frequencies using multiple hash functions and a 2D counter array. Width vs. depth tradeoffs, the error model, and applications for streaming heavy hitters and rate limiting.
How roaring bitmaps store and operate on integer sets 10-100x more space-efficiently than arrays or hash sets. How they power fast set operations in Druid, ClickHouse, and Elasticsearch, and when to use them.
How segment trees enable efficient range queries and range updates in O(log N), the data structure behind real-time leaderboards, financial analytics, and database range aggregations.
How MapReduce splits data, moves it between map and reduce phases via the shuffle and sort stage, how combiners reduce network I/O, and how speculative execution handles stragglers in large clusters.