Back-of-envelope estimation: одна e-commerce-архитектура (CDN, LB, API, Redis cache, Postgres primary + read-replica), 4 сценария роста — 1K / 100K / 10M / 300M DAU. Каждый сценарий показывает где появляется bottleneck и какое решение его снимает. Демонстрирует каркас оценки в 5 шагов: DAU × ops × peak factor → RPS, payload × ops × users × retention → storage, read/write ratio → cache+replica/sharding decisions.
The goal is not a precise-looking infrastructure count. It is a reviewable chain from assumptions to units, architecture and experiments. This example models a photo-upload service; every product number below is a teaching assumption, not a claim about a named company.
Use low/base/high ranges for uploads/user, payload distribution, peak factor, retention and derived-media ratio. A mean payload alone is insufficient for memory and timeout sizing; retain p50/p95/p99 and maximum limits.
Daily upload starts:
10,000,000 users × 2 uploads/user/day = 20,000,000 uploads/day.
Average start rate:
20,000,000 / 86,400 ≈ 231.5 uploads/s.
Explicit peak scenario:
231.5 × 5 ≈ 1,158 uploads/s, rounded to about 1,160/s.
At 4 MiB mean payload, peak object ingress is:
1,158/s × 4 MiB ≈ 4,632 MiB/s ≈ 4.52 GiB/s.
Eight bits per byte gives about 38.9 Gbit/s of payload. TLS, HTTP, retransmission and aborted multipart overhead must be measured and added. Direct signed upload keeps that byte stream off the Upload API; the API is sized mainly for intent/completion request QPS and database work.
Logical original bytes per day:
20,000,000 × 4 MiB = 80,000,000 MiB ≈ 76.3 TiB/day.
First-year originals:
76.3 TiB/day × 365 / 1,024 ≈ 27.2 PiB.
Metadata:
20,000,000 × 2 KiB ≈ 38.1 GiB/day ≈ 13.6 TiB/year.
These are logical baselines. Add independent terms for derived variants, replication or erasure coding, object/version retention, incomplete multipart uploads, database indexes/WAL, compaction headroom, backups and migration space. Do not multiply by a storage factor until its semantics are clear.
The client first obtains an upload id plus an expiring signed URL restricted by owner, object key, size and content policy. Object storage validates checksum/size where supported. Object-created events are at-least-once, so media processing uses deterministic output keys and a stable source version. Metadata becomes ready only after required variants exist.
Unknown completion and duplicate events are normal recovery paths. Retries keep the same upload/event identity. A queue absorbs finite bursts; if arrival exceeds processing for long enough, oldest-event age grows. Measure worker service time and use Little's Law for average in-flight work, then load-test tails, memory and codecs.
Inputs are labelled and separated from arithmetic.
Signed upload, at-least-once completion and idempotent media processing.
Average and peak start rate plus byte/bit ingress conversion.
Original and metadata storage with binary units.
One-variable-at-a-time review of bottlenecks and required measurements.
Введите числа или выберите пресет