Tech Insights

A collection of important technical takeaways and learnings

Showing All Posts

Blue/Green vs Canary Deployments

Six deployment strategies (recreate, rolling, blue/green, canary, feature flags, shadow) compared. When each makes sense and the database problem common to all of them.

Kubernetes Architecture

The control plane and worker nodes. Pods, deployments, services, ingress. The reconciliation loop that makes K8s self-healing.

Docker Fundamentals

What containers actually are. Images, layers, volumes, networking, and Docker Compose. Best practices for production Dockerfiles.

How CI/CD Actually Works

CI vs CD vs CD. The pipeline stages from git push to production. The build-once-promote pattern, branch strategies, feature flags, and pipeline security.

DNS Deep Dive

The hierarchy (root, TLD, authoritative), record types, TTLs and caching, GeoDNS, and why so many internet outages start with DNS.

gRPC vs REST

Performance, tooling, ecosystem. When to pick which, the GraphQL aside, and the hybrid approach most large companies actually use.

WebSockets vs SSE vs Polling

Three approaches to real-time updates from server to browser. Latency, complexity, browser support, and operational concerns compared.

TCP vs UDP

Reliability vs speed, the protocols' actual behavior, where each shines, and how QUIC blurs the line between them.

HTTP/1 vs HTTP/2 vs HTTP/3

Head-of-line blocking, multiplexing, HPACK header compression, and QUIC. How each version solved the bottleneck of the last.

API Authentication Patterns

API keys, Basic Auth, JWT bearer tokens, OAuth, HMAC signing, mTLS, sessions. The major patterns compared with when to use each.

Password Hashing Done Right

Argon2id, bcrypt, salts, peppers, and the parameters that actually keep credentials safe. Plus passkeys as the future.

The TLS/SSL Handshake

What happens when you visit an HTTPS site. The TLS 1.2 vs TLS 1.3 handshakes, certificates, the trust chain, cipher suites, and why symmetric crypto follows asymmetric.

JWT (JSON Web Tokens) Explained

The signed JSON token format, claims, signatures, where JWTs fit, and the security pitfalls (the alg=none attack, revocation, storage).

How OAuth 2.0 Works

The protocol behind "Sign in with Google." Roles, the Authorization Code flow with PKCE, scopes, tokens, and OpenID Connect on top.

Fine-tuning vs RAG vs Prompt Engineering

Three ways to customize LLM behavior. When each makes sense, the trade-offs, and why fine-tuning is overrated for most use cases.

Embeddings and Semantic Search

How embeddings turn meaning into vectors, how to build semantic search, hybrid search with BM25, reranking, and beyond-text embeddings.

Vector Databases Explained

Why traditional databases can't do similarity search. ANN algorithms (HNSW, IVF), the major players (Pinecone, Weaviate, Qdrant, pgvector), filtered and hybrid search.

Building a Real-Time Data Pipeline

The four-layer architecture: sources, buffer, stream compute, sinks. Windowing, late data, watermarks, and the operational concerns that make real-time hard.

Kafka Use Cases and Patterns

Practical Kafka scenarios with concrete topic design, producer/consumer code, and gotchas. Order fanout, CDC, activity tracking, event sourcing, sagas, and when NOT to use Kafka.

Stream Processing with Kafka

What Kafka actually is (a distributed log). Topics, partitions, consumer groups, exactly-once semantics, and the major stream processing frameworks.

Change Data Capture (CDC)

How CDC streams database changes from the transaction log. Why it beats dual-write and polling. Debezium, Maxwell, and the snapshot problem.

CDN Deep Dive

How CDNs work. Anycast routing, cache hierarchies, purging strategies, edge compute, and why most modern web apps need one.

Cache Invalidation Strategies

The famously hard problem. TTL expiration, event-based, write-through, versioning, tag-based, and the cache stampede problem.

Designing YouTube

Streaming video at planet scale. Upload pipeline, transcoding, adaptive streaming (HLS/DASH), CDN caching, and live streaming.

Designing Dropbox / Google Drive

File sync at scale. Block-level deduplication, sync protocols, conflict resolution, sharing, and bandwidth optimizations.

Designing a Web Crawler

Politeness, deduplication (Bloom filters), URL frontier with per-domain rate limits, the dynamic web (JS-rendered pages), and the DNS bottleneck.

Designing Search Autocomplete

Tries, prefix indexing, ranking, personalization, and the cached top-K trick that makes autocomplete a single key-value lookup.

Designing a News Feed

Beyond chronological order. The three-stage pipeline (candidate generation, ranking, re-ranking), feature stores, ML latency budgets, and the cold start problem.

Designing a Notification System

Multi-channel push, email, SMS, in-app at scale. Templates, deduplication, user preferences, throttling, priority queues, and the notification storm problem.

Designing Uber's Geo Service

Matching riders with drivers in real time. Geohashing and S2 cells, location updates, the dispatch flow, hot cell mitigations, and surge pricing.

Designing Twitter's Timeline

The classic system design problem. Push vs pull, the hybrid fan-out approach for celebrities, storage choices, and what makes the timeline feel real-time.

Distributed Locks

How distributed locks work, their hidden pitfalls (GC pauses, expired leases), Redlock controversy, fencing tokens, ZooKeeper-style locks, and when you should use a different pattern entirely.

Idempotency in Distributed Systems

Why every distributed system needs idempotent operations, the idempotency key pattern (as used by Stripe and AWS), implementation tactics with database constraints or Redis, and the edge cases.

Circuit Breakers and Bulkheads

How circuit breakers stop cascading failures and bulkheads contain blast radius. Covers the three states, tuning parameters, fallbacks, and combining both patterns for resilient services.

Leader Election

How distributed systems agree on a single leader. Covers the Bully algorithm, Raft, Paxos, ZooKeeper-style locks, fencing tokens, and the failure detection problem at the core of split-brain bugs.

Database Replication

A guide to replication topologies (leader-follower, multi-leader, leaderless), sync vs async vs semi-sync, replication lag, failover handling, and split-brain prevention.

SQL vs NoSQL

A practical comparison of SQL and the four main NoSQL families (document, key-value, wide-column, graph). Covers when to pick which, the myths about SQL not scaling, and polyglot persistence.

Database Indexing

A practical guide to database indexes: B-trees, hash indexes, LSM-trees, composite and covering indexes, and how to spot a bad index with EXPLAIN.

Designing a Chat System

An end-to-end design of a real-time chat system at WhatsApp scale. Covers WebSockets, message storage, sequence numbers, fan-out for group chats, presence service, push notifications, and end-to-end encryption.

MCP Deep Dive

Model Context Protocol from first principles. The host/client/server architecture, JSON-RPC transports, tools, resources, prompts, security, and how MCP turns the M times N integration problem into M plus N.

RAG: Retrieval-Augmented Generation

A practical guide to RAG. Covers why RAG exists, embeddings, chunking strategies, vector databases, retrieval, hybrid search, reranking, and when to use RAG vs fine-tuning.

Database Sharding and Partitioning

A practical guide to sharding strategies (range, hash, geographic, directory), shard key selection, hotspot mitigation, cross-shard queries, and resharding. Plus when not to shard.

The CAP Theorem

A clear walkthrough of the CAP theorem: what consistency, availability, and partition tolerance really mean, why network partitions force a choice between CP and AP, and how real databases like MongoDB, Cassandra, and DynamoDB pick.

Consistent Hashing

How distributed systems split data across servers so that adding or removing one server moves only 1/N of the data instead of breaking everything. Covers the hash ring, virtual nodes, and where it's used in real systems.

Designing an API Rate Limiter

A comprehensive walkthrough of designing a distributed API rate limiter. Covers fixed window, sliding window, token bucket, and leaky bucket algorithms; deployment options; Redis with Lua for atomic operations; HTTP 429 headers; and production concerns like hot keys and failover.

Designing a URL Shortener

An end-to-end system design walkthrough. Covers requirements, capacity estimation, Base62 encoding, distributed ID generation, sharding, the thundering herd problem, async analytics, and rate limiting. With full architecture diagrams.

Eventual Consistency Patterns

A comprehensive guide to the four core eventual consistency patterns: Event-based, Background Sync, Saga (choreography and orchestration), and CQRS. With diagrams, real-world examples, failure modes, and a decision guide.

Hands-On: Building a Lakehouse with Iceberg

A practical, runnable walkthrough using PyIceberg, DuckDB, and a SQLite catalog. Build a music streaming lakehouse on your laptop. Covers ingestion, queries, schema evolution, time travel, and maintenance.

Data Lakehouse Architecture

A comprehensive guide to data lakehouses. Compares warehouses, lakes, and lakehouses. Covers the three building blocks (object storage, open table formats, shared catalog), governance, trade-offs, and a decision tree for choosing.

Data Pipelines Explained

A comprehensive guide to data pipelines: the 5 phases, batch vs streaming, ETL vs ELT, Lambda vs Kappa architectures, common tools at every stage, and how to handle failures.

What Does ACID Mean

A comprehensive guide to ACID properties in databases: Atomicity, Consistency, Isolation, and Durability. Explained with real-world scenarios, diagrams, isolation levels, and the ACID vs BASE trade-off.

Implementing Read Through with Redis

A complete guide to implementing the Read Through caching pattern with Redis and Python. Covers TTL strategies, cache invalidation, error handling, and production considerations.

Serving LLMs at Scale

Why vLLM and PagedAttention matter for serving Large Language Models at scale. Covers inference engines, the KV cache problem, and how paging solves it.

Caching Strategies: Overview

A detailed breakdown of the top 5 caching strategies: Cache Aside, Read Through, Write Around, Write Back, and Write Through. With visual diagrams and real-world analogies.