SystemKit

Design an offline-first notes app

Carry the chapter's sync ideas to small text documents, where a conflict can be merged instead of copied.

The brief

People write short text notes on a phone, a laptop, and a tablet. Every note must open and accept edits with no network, and all of a person's devices must converge when they reconnect. Design the first version for 2 million registered users. Sharing with other people, rich formatting, and server-side search are outside this exercise.

  • 2 million registered users; 500,000 are active each day, with 3 devices each on average. At peak, 20% of those devices hold an open connection.
  • Each active user makes 40 saves per day, where a save is a batch of typing sent after a pause. A note averages 4 KB of text. As a conservative ceiling, each save sends and stores the full note.
  • Each user keeps 500 notes on average, and revisions are kept for 30 days. Peak traffic is 4 times the daily average. Use decimal units and 86,400 seconds per day.
  • An edit should reach another online device within 5 seconds at p95. Treat this as a target to verify, not a guarantee from the architecture.
  • A device may stay offline for 60 days and must still sync afterward. Text a person typed must not disappear silently, including when two devices edit one note.

Reading a design isn’t the same as producing one under a clock. Try it timed: the requirement change stays hidden until partway through.

Loading your draft…

State your scope and assumptions. Estimate average and peak saves per second, daily upload bytes, storage for current notes, and 30 days of revisions. Say which number, if any, forces a bigger design.

0 / 4,000 characters

Name what lives on the device and what lives on the server. Trace one offline edit from the keystroke to another device, including what each side saves durably and when.

0 / 4,000 characters

Two devices edit one note offline. Explain exactly what happens to both sets of text. Then cover a lost response, a missed wake-up hint, an edit to a note deleted elsewhere, and a device returning after 60 days.

0 / 4,000 characters

Respond to the photo change below. Decide where photo bytes live, how they upload, and what another device shows before they arrive. Explain one cost of your change.

The requirement changesNotes may now include photos. Assume 10% of active users attach one photo a day, averaging 3 MB, and a photo should stay viewable offline on any device that has downloaded it. Decide how a photo travels, what another device shows before it arrives, and what the new cost is.

0 / 4,000 characters

Write an initial response in all four sections to unlock the checklist and two worked approaches.