Skip to content
System Designer

Hard · Telecom and messaging

Bulk text campaigns

Businesses send a coupon or an alert to hundreds of thousands of phones at once. Carriers accept texts only at a fixed speed, every text costs real money, and a person who replied STOP must never be texted again. Delivery receipts come back by the thousand and must be counted. Practise this hard system design problem for free with a Google or GitHub account.

The brief

Businesses send a coupon or an alert to hundreds of thousands of phones at once. Carriers accept texts only at a fixed speed, every text costs real money, and a person who replied STOP must never be texted again. Delivery receipts come back by the thousand and must be counted.

Think of the platform behind store coupons and delivery alerts, like Twilio or Braze.

Users, scale and requirements

Who uses it
60 thousand businesses (approx.)
Audience in plain numbers
60,000 users or devices
Normal peak
≈ 30 requests per second
Request mix
Notification: 40%; Analytics event: 35%; Write: 10%; Read: 15%
Speed for 99 of 100 requests
Write: ≈ 500 ms; Read: ≈ 500 ms
Successful requests
99.9%
Data safety
No acknowledged write may be lost.
Monthly budget
≈ $140,000
Data at rest
≈ 5 TB
Where users are
North America: 60%; Europe: 30%; Asia Pacific: 10%
Home region
North America
Waiting deadlines
Notification: 900 seconds; Analytics event: 3,600 seconds; Write: 3,600 seconds; Read: 900 seconds
Required proofs
Audit trail

≈ marks an approximation, just as in the game. Waiting deadlines measure the age of queued work and are separate from interactive response time.

  • Carrier throughput is fixed. Estimate peak sending rate before sizing the queue.
  • Each text costs about a cent, so a repeated send is a visible bill (approx.).
  • All numbers are rough approximations.
  • Notification speed measures provider acceptance. Device receipt is outside this traffic model; check expiry, provider outcome and retries in the correctness trace before claiming delivery guarantees.

Questions that shape the design

Can a campaign take a few minutes to finish?

Yes, within its window. Sending slower than the carrier allows is fine. Sending faster gets you blocked.

Can a phone get the same text twice?

No. Retries after a carrier timeout must not send it again, and a repeat is real money wasted.

What about people who texted STOP?

They must be checked before every send, and the check is audited. One wrong text can be a legal problem.

Do receipts have to be instant?

No. A few minutes is fine, but none may be lost or counted twice.

The traffic day

Traffic concentrated in working hours. The clock covers 00:00 to 24:00 in the home region. Events add pressure on top of that normal traffic.

  1. 09:30 · Provider rate limit

    An outside service lowers its configured request quota and answers 'too many requests' above the reduced limit.

    Provider capacity falls to 70% of its configured quota. Duration: ≈ 1,200 seconds.

  2. 12:00 · Duplicate delivery

    The queue redelivers messages. Without duplicate protection, side effects may be applied twice.

    Affected share: 3%. Duration: ≈ 3,600 seconds.

  3. 16:00 · Poison message

    One malformed message crashes every worker that picks it up, again and again.

    Lasts until detected and repaired.

What a strong design has to handle

  • The carrier sets the speed, not you. What holds the work while it waits, and what makes a retry safe?
  • Honor opt-outs at send time and reconcile billable carrier submissions.
  • Sending at the carrier pace protects the account, but a huge campaign takes minutes instead of seconds.
  • Checking consent before every send is slower than checking once per campaign, and it is the only way STOP is honoured at once.

Make a prediction, run a full traffic day, then compare the result. The in-game editorial opens after a finished day and includes measured reference designs.

Concepts to practise

Related problems