Search

Lessons (37)

  • Caching & Redis

    … GET product:42 alt cache hit ✅ Cache-- App: data (0.5 ms) else cache miss ❌ Cache-- App: null …

  • Caching, Consistent Hashing and Sharding

    Move reads close to users, distribute data safely, and understand cache and database consistency costs. Three different tools …

  • Docker & Containers

    … redis://cache:6379 depends on: db: { condition: service healthy } cache: { condition: service started } db: image: postgres:17 environment …

  • Design a URL Shortener

    … durable mappings, cache-backed redirects and asynchronous analytics](/img/system-design-l6/url-shortener.svg) Generate a Base62 …

  • How a Web Request Works

    … DNS translates them, with caching at every level: the browser, the OS, your router and your ISP. mermaid …

  • Proxies, APIs and Real-Time Protocols

    … it can terminate TLS, route, cache and rate-limit. A queue is not a WebSocket, and a WebSocket …

  • Design a Social Media Feed

    … write a post once, then fan out to inboxes or merge on read behind a cached timeline API …

  • Frontend Performance & Core Web Vitals

    … Guessing leads to useMemo everywhere and no real gain. Caching and network - HTTP caching: Cache-Control: public, max …

  • Debug Latency Like an Investigator

    … morning Batch reports, backup, cache expiry, scheduled work. Restart helps briefly Warm cache, leak, churn, periodic trigger. Safe …

  • State Management (Redux, Zustand, TanStack Query)

    … TanStack Query ⭐ About 80% of "global state" in typical apps is really cached server data . It has special …

  • Structural Patterns: How to Connect Objects

    … lazy loading, caching, access control, logging, validation. js const user = { name: "Ana", role: "user", balance: 100 }; // JavaScript has …

  • Scaling, Load Balancing & Rate Limiting

    … balancer + many stateless app servers"] S3 -- S4["4️⃣ Cache (Redis) + CDN for static files"] S4 -- S5["5️⃣ DB …

  • REST vs GraphQL vs gRPC

    … one WHERE author id IN (...) . GraphQL challenges: HTTP caching is harder (everything is a POST to one URL …

  • React Hooks in Practice

    … They handle caching, deduplication, retries and race conditions for you. You might not need an effect Effects are …

  • Design an E-Commerce Checkout

    … checkout.svg) Catalog, search and recommendations can be cached and eventually consistent. Checkout cannot: reserve inventory atomically, create …

  • API Gateway, BFF & Service Discovery

    … http://catalog-svc:8080 plugins: [cache: { ttl: 60 }] ⚠️ Keep business logic out of the gateway. It should route …

  • Which Pattern Do I Need?

    … simple entry point"] -- FA[Facade] P7["Control access, cache,<br/ lazy-load"] -- PR[Proxy] P8["Tree of items …

  • Next.js Rendering: CSR, SSR, SSG, ISR & Server Components

    … The more stays on the server, the less JavaScript your users download. Controlling caching in the App Router …

  • Premiere-Night Video Streaming

    … first segments at edges. - Use edge → regional → origin caches and request collapsing. - Pre-scale entitlement and manifest services …

  • Storage Engines & Database Operations

    … age, slow-query fingerprints, lock waits, replica lag, cache hit rate, WAL/checkpoint or compaction work, disk growth …

  • Linked Lists

    … One contiguous block Nodes scattered, linked by pointers Cache friendliness ✅ great ❌ worse Insert after a node: just rewire …

  • Replication, Partitioning & Sharding

    … Do not shard because it sounds scalable; exhaust indexing, caching, replicas and partitioning where appropriate first.

  • N+1 Queries, Loading & Pagination

    … to parents correctly GraphQL/resolvers Request-scoped DataLoader Cache only for request, not forever Do not eagerly load …

  • SQL vs NoSQL Databases

    … Redis for caching, Elasticsearch for search, Cassandra for huge write volumes. Using several databases for different jobs is …

  • Helm, kubectl Cheat Sheet & Best Practices

    … bitnami helm install my-redis bitnami/redis --namespace cache --create-namespace --set auth.enabled=true helm list -A …

  • Dynamic Programming

    … memoisation"] direction TB t1["Start from the big problem"] -- t2["Recurse into smaller ones"] -- t3["Cache every answer …

  • What Are Design Patterns?

    … execute ). - Singleton → an ES module export (modules are cached). - Iterator → built in with Symbol.iterator and generators. This …

  • YAGNI: You Aren't Gonna Need It

    … Generic BaseAbstractManager<T classes Error handling and security Caching layer before measuring slowness Code that is easy to …

  • KISS: Keep It Simple, Stupid

    … Add microservices, queues and caches when real problems show up, not before. How to practise KISS Ask yourself …

  • Hash Maps & Sets

    … K2 bat -- K3["key 'abt'"] Real-world uses - Caches (Redis is essentially a giant networked hash map) - Database …

  • Service Communication: Sync vs Async

    … a cached value, a default, or a degraded feature. All covered in Resilience Patterns . Avoid chatty services mermaid …

  • Message Queues & RabbitMQ

    … to every bound queue, ignore the key Broadcast "cache clear" Headers Match on message headers Rarely used Code …

  • What Is Software Architecture?

    … with… --- --- Scalability (microservices) Simplicity, consistency, operating cost Performance (caching) Freshness of data, complexity Flexibility (many abstraction layers) Readability …

  • REST API Design

    … Clients, caches and monitoring tools all rely on the status code. Rule 3: Consistent error format Pick one …

  • Creational Patterns: How to Make Objects

    … a database pool, a config object, a logger. js // db.js — ES modules are evaluated ONCE and cached …

  • Scaling & Health Probes

    … DB reachable, caches warm Startup Has a slow app finished starting? Other probes wait; restarts only after the …

  • Resilience Patterns

    … erroring: Failed dependency Fallback --- --- Recommendations Show best-sellers (cached) or hide the section Reviews "Reviews are temporarily unavailable …