EasyStarter

Email Newsletter Service

DatabasesAPI DesignMessage Queues

Problem Statement

MailDrop is building a simple newsletter platform for independent creators (think Substack lite). Features:

- Subscriber management - creators collect email addresses via a sign-up form. Support double opt-in (confirmation email). Easy unsubscribe.Campaign editor - write newsletter emails with a rich text editor. Preview before sending. Schedule sends for a future date/time.Sending - deliver emails to all subscribers reliably. Handle bounces, and automatically remove hard-bounced addresses.Analytics - track open rate (via tracking pixel), click-through rate (via redirect links), and unsubscribe rate per campaign.Segments - create subscriber segments by tag (e.g., "free" vs "paid") and send targeted campaigns.

Targeting 5,000 creators with an average of 2,000 subscribers each (10 million emails per week total).

What You'll Learn

Design an email newsletter platform for creators to manage subscribers, write campaigns, and track opens. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.

DatabasesAPI DesignMessage Queues

Constraints

Creators~5,000
Total subscribers~10,000,000
Emails sent/week~10,000,000
Send completion time< 2 hours per campaign
Open tracking accuracy> 90%
Availability target99.5%
ApproachClick to expand

Interview-Ready Approach

1) Clarify Scope and SLOs

  • Problem statement: Design an email newsletter platform for creators to manage subscribers, write campaigns, and track opens.
  • Design for a peak load target around 500 RPS (including burst headroom).
  • Creators: ~5,000
  • Total subscribers: ~10,000,000
  • Emails sent/week: ~10,000,000
  • Send completion time: < 2 hours per campaign
  • Open tracking accuracy: > 90%

2) Capacity Planning Method

  • Convert traffic and growth constraints into request rate, storage growth, and concurrency budgets.
  • Keep at least 2-3x safety margin per tier (ingress, compute, storage, async workers).
  • Reserve explicit latency budgets per hop so p95 can be defended in review.

3) Architecture Decisions

  • Databases: Define a clear system-of-record and design read/write paths separately before adding optimizations.
  • API Design: Standardize API boundaries, idempotency keys, pagination, and error contracts first.
  • Message Queues: Move non-blocking and retry-heavy work to async consumers with explicit retry and DLQ policies.

4) Reliability and Failure Strategy

  • Use strong write constraints (transactions or conditional writes) and explicit backup/restore strategy.
  • Apply strict input validation and backward-compatible versioning.
  • Guarantee idempotent consumers and trace every message with correlation IDs.

5) Validation Plan

  • Run one peak-load test, one dependency-degradation test, and one failover test.
  • Verify idempotency for all retried writes and async consumers.
  • Track user-facing SLOs first: p95 latency, error rate, and successful throughput.

6) Trade-offs to Call Out in Interviews

  • Databases: SQL gives stronger transactional guarantees; NoSQL often gives better write scaling and flexibility.
  • API Design: Rich APIs improve developer speed but can create long-term compatibility burden.
  • Message Queues: Async pipelines absorb spikes well, but increase eventual-consistency complexity.

Practical Notes

  • Sending millions of emails requires a queue - enqueue one task per recipient, workers pull from the queue and call the email provider (SES, SendGrid).
  • Open tracking: embed a 1×1 transparent pixel with a unique URL. When loaded, record the open event.
  • Click tracking: rewrite all links to go through your redirect server, which logs the click then forwards to the original URL.

Learn the Concept

Practice Next

Reference SolutionClick to reveal

Why This Solution Works

Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.

Reference flow: Web Clients -> API Gateway -> API Service -> Primary SQL DB -> Message Queue

Design strengths

  • Async queue/event bus isolates bursty workloads and supports retries without blocking synchronous requests.

Interview defense

  • This design makes bottlenecks explicit (ingress, core compute, persistence, async workers).
  • It supports progressive scaling without re-architecting the core request path.
  • It keeps correctness-sensitive state changes in durable systems while offloading background work asynchronously.