System Design Notebook / 01

Large-Scale Data Ingestion

How to accept, store, process and track multi-gigabyte jobs without losing them

Accepting a multi-gigabyte upload is not a bigger version of accepting a form. This one walks the whole path: presigned URLs, multipart and resume, the outbox pattern, the queue, and how a caller finds out the job is still alive.

pages
68
sections
35
editions
Reading, Print, Tablet

Sign in to read it

The whole notebook is free for 7 days. No card, no payment. We ask for an account so the download link belongs to someone.

Sign in with GitHub or Google

What is inside

The full table of contents. Nothing here is hidden: if a section you need is not in this list, the notebook is not the right one and you should not spend a week on it.

  1. The whole system on one page
  2. 1. The problem, stated properly
  3. 2. Clarifying questions that buy you the design
  4. 3. Back-of-the-envelope, before the boxes
  5. 4. The first principle: separate ingestion from processing
  6. 5. Why object storage, not the database
  7. 6. Presigned URLs, keeping the bytes out of your backend
  8. 7. Multipart and resumable upload
  9. 8. Choosing the part size
  10. 9. When the network fails mid-upload
  11. 10. Completing the upload and verifying it
  12. 11. The dual-write problem and the outbox
  13. 12. Why a queue at all
  14. 13. Kafka or RabbitMQ or SQS
  15. 14. The worker loop
  16. 15. Streaming, never loading
  17. 16. Chunking and checkpointing
  18. 17. Idempotency
  19. 18. The lease problem: when the queue thinks you died
  20. 19. Parallelising one big file
  21. 20. Retries, poison pills and the DLQ
  22. 21. The job state machine
  23. 22. Progress without hammering the database
  24. 23. Telling the frontend
  25. 24. Scaling: workers, backpressure and queue depth
  26. 25. Multi-tenancy and fairness
  27. 26. Partial failure: what "failed" means
  28. 27. Cost, the bill nobody mentions
  29. 28. Observability and security
  30. 29. The seven-step delivery script
  31. 30. Whiteboard drawing order
  32. 31. Follow-up question bank
  33. Appendix A. Numbers to memorise
  34. Appendix B. Glossary
  35. Appendix C. Self-test

How to read it

Read with a pen. Every notebook opens with a question to answer before you start and asks you to redo the answer at the end, and the margin in the Print edition exists so you have somewhere to be wrong first. The Tablet edition is 16:9 with vector text, so note apps draw on it rather than treating it as a photograph.

more notebooks