Search
Lessons (40)
- Design a URL Shortener
Turn long links into short ones that never get lost, redirect in milliseconds, can be switched off fast …
- Caching & Redis
… 4200, value: "ana" }); await redis.zIncrBy("leaderboard", 50, "bo"); const top10 = await redis.zRangeWithScores("leaderboard", 0, 9, { REV …
- Edge, Platform & Frontend Delivery
… NextRequest) { const session = request.cookies.get("session"); if (!session && request.nextUrl.pathname.startsWith("/account")) { return NextResponse.redirect(new …
- Scaling, Load Balancing & Rate Limiting
… Prefer stateless instances with sessions in Redis or signed tokens. Then any healthy instance can serve the next …
- L — Liskov Substitution Principle
… set(k, v) }; const redisStorage = { get: (k) = redis.get(k), set: (k, v) = redis.set(k, v) }; function …
- Docker & Containers
… postgres://app:secret@db:5432/shop REDIS URL: redis://cache:6379 depends on: db: { condition: service healthy } cache …
- Authentication, Authorization & API Security
… App- U: redirect to Google (+ PKCE challenge) U- G: log in + consent G- U: redirect back with ?code …
- Flash Sale: 10 Million Buyers, No Oversell
… Success means zero oversells , not just "a low error rate". Check your understanding Why can't a Redis …
- Linux Command-Line Essentials
… the folder layout, moving around, reading and editing files, pipes and redirection, and searching logs with grep and …
- SQL vs NoSQL Databases
… four families mermaid mindmap root((NoSQL)) Document MongoDB Firestore JSON documents Key-value Redis DynamoDB get / set by …
- NestJS Core Concepts
… StripeGateway }, { provide: "APP NAME", useValue: "shop-api" }, { provide: "REDIS", useFactory: async (config: ConfigService) = createClient({ url: config.get("REDIS …
- Bash Scripting & Scheduled Jobs
… s output is lost (or emailed) unless you redirect it: file.log 2 &1 . - Times are in the …
- A WhatsApp OTP Is Only Single Use If You Make It So
… a token service, Redis, another microservice. Then one transaction is impossible. You have two separate steps, and you …
- Distributed Coordination: Consensus, Heartbeats and Gossip
… Check your understanding Your scheduler uses only a Redis lock with a TTL (time to live: the lock …
- Backend Design Scenarios
… In a multi-instance deployment, store shared counters in Redis or use a gateway with distributed quota support …
- KISS: Keep It Simple, Stupid
… Profile service] MS1 -- K[(Kafka)] -- MS2 MS3 -- R[(Redis)] end subgraph Simple["✅ 3 users, day one"] direction LR …
- Hash Maps & Sets
… bat -- K3["key 'abt'"] Real-world uses - Caches (Redis is essentially a giant networked hash map) - Database indexes …
- How a Web Request Works
… 200 OK, 201 Created, 204 No Content 3xx ↪️ Redirect 301 Moved Permanently, 304 Not Modified 4xx 🙋 Client made …
- Practical Lab: S3 File Upload and CloudFront Delivery with NestJS
… Use the regional bucket domain ( BUCKET.s3.REGION.amazonaws.com ), not the global one, to avoid redirect problems …
- Interfaces vs Abstract Classes
… Promise<void ; } class RedisCache extends PrefixedCache { / … / } class MemoryCache implements Cache { / doesn't need the base at all / } Code …
- Message Queues & RabbitMQ
… SNS Managed queue / pub-sub Serverless, no ops Redis Streams / BullMQ In-memory streams Lightweight background jobs in …
- Observability: Logs, Metrics & Traces
… new NodeSDK({ instrumentations: [getNodeAutoInstrumentations()] }).start(); // HTTP, Express, pg, redis, fetch… are now traced automatically SLIs, SLOs and error …
- CQRS & Event Sourcing
… joined, pre-computed Storage Postgres (transactions) Elasticsearch (search), Redis (fast lookups), a reporting DB Scaling Consistency matters Scale …
- Node.js and Express
… true }) , never with cookies Rate limiting express-rate-limit (with a Redis store when you run several instances …
- DynamoDB Modeling, RDS Scaling and Data Resilience
… for low-latency reads and disaster recovery. - ElastiCache (Redis or Valkey) absorbs repeated reads. - Fix queries first: use …
- CloudFront: Faster Websites and Safer File Delivery
… the default root object to index.html . 5. Redirect HTTP viewers to HTTPS and allow only needed methods …
- Concurrency, Resilience & Distributed Workflows
… Use a database/Redis lock or a unique execution key when only one run is allowed. Backpressure means …
- Domains, Load Balancers and HTTPS
… HTTPS listener on 443 using the certificate. 5. Redirect the HTTP listener on 80 to HTTPS if exposing …
- SSH, Networking & Firewalls
… 80/tcp HTTP (needed for Let's Encrypt + redirect to HTTPS) sudo ufw allow 443/tcp HTTPS sudo …
- AWS Databases: Choose the Right One
… key DynamoDB Fast temporary cache or sessions ElastiCache Redis/Valkey MySQL/PostgreSQL compatible SQL with AWS-managed clustered …
- Docker in Production on a Single Server
… apps with different Node versions Awkward ✅ Easy Database, Redis, proxy alongside Installed on the host One file, one …
- Nginx Reverse Proxy & HTTPS
… the certificate and adds "listen 443 ssl" → optionally redirects HTTP to HTTPS (say yes) sudo certbot renew --dry …
- Python Web APIs: FastAPI and Django
… state (dicts) in production Use a database or Redis: several workers don't share memory Key takeaways - FastAPI …
- Timeouts, Retries & Backpressure
… walk. Retry "That failed, let me try again." Redialing a phone number that was busy. Backpressure "I'm …
- Deploy a Node.js App to a VPS, Step by Step
… nginx -d example.com -d www.example.com --redirect Step 10: Verify like a pro bash systemctl is …
- Proxies, APIs and Real-Time Protocols
… 3. Store "who's connected where" in shared, short-lived storage (like Redis), not in one server's …
- 500 Users Upload Documents at Once: Design the Background Job Pipeline
… A waiting line that hands work to workers (Redis or RabbitMQ). The pile of tickets on the counter …
- System Design Interview Framework
… The candidate starts drawing boxes right away: "Load balancer, Kafka, Cassandra, Redis..." 2. After 20 minutes, the interviewer …
- Premiere-Night Video Streaming
… 34" message) every so often. - Write it to Redis (a fast in-memory store) so "resume" is quick …
- The L6 System-Design Thinking Loop
… The team picks tools first ("let's use Kafka and Redis") without saying what must never break. 2 …