Learn

A design doc for every template

Each guide is written like an engineering design doc: the context, goals and non-goals, the numbers that size the system, why each component is there, the alternatives, and what fails under load. Then open the same system in the lab, break it, and fix it.

  1. 01Beginner12 min readRead-heavy product catalogCache-aside in front of a database, and what happens to the database when the cache goes cold.Cache-asideHit rateCache stampedeDatabase capacity
  2. 02Beginner12 min readSlow database rescueTimeouts, retries and why a slow dependency can take down everything in front of it.TimeoutsRetriesRetry amplificationLittle’s law
  3. 03Intermediate10 min readPayment webhook processorAt-least-once delivery, duplicate side effects, and idempotency keys.At-least-once deliveryIdempotencyVisibility timeoutExactly-once effects
  4. 04Intermediate12 min readURL shortenerA read-heavy key-value system where one viral link can overload a single partition.Key-value storesPartitioningHot keysZipf popularityCost budgets
  5. 05Intermediate12 min readEvent pipeline catching upKafka-style streams: consumer lag, partitions as the limit on parallelism, and data lost to retention.Event streamsConsumer groupsPartitionsLagRetention
  6. 06Intermediate15 min readRAG support assistantRetrieval-augmented generation where the bottleneck is the model provider’s token quota, not your servers.RAGEmbeddingsVector searchToken quotasSemantic cacheTime to first token
  7. 07Intermediate12 min readEdge defence: survive a DDoSLayered protection at the edge: DDoS scrubbing, a WAF and bot management in front of your system.DDoSWAFBot managementDefence in depthFalse positives
  8. 08Advanced15 min readAgent runawayAn AI agent loop where steps multiply model calls into quota errors, latency and cost.AgentsTool useStep limitsModel quotasPrompt cachingCost
  9. 09Advanced25 min readYouTube end to endA full video platform: path routing, a real-world metadata cache, async uploads and transcoding, view counting, and capacity limits.Path routingCDNSharded SQLCache sizingAsync pipelinesKafkaCapacity planning
  10. 10Intermediate12 min readLLM gateway with fallbackOne door to your models: a prompt cache, model response time, and a second provider that takes over when the first fails.AI gatewayProvider fallbackTime to first token429s and outagesPrompt cacheCost per call
  11. 11Advanced15 min readMCP agent platformAgents that think with a model and act through MCP tools: steps multiply calls, errors and cost.MCPAgent loopTool serversCompounding errorsAgent memoryCost per task
  12. 12Advanced15 min readDocument Q&A on S3 and a vector DBUpload documents to S3, ingest them into a vector database, and answer questions with a model: two paths sharing one embedding quota.RAGS3SQS ingestionEmbeddingsVector index memoryModel response time