Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 37

Design a wiki-style document management system

Intermediate · 35 min · Storage & data modeling

Teams keep their docs in a workspace of nested pages: specs, runbooks, meeting notes. People open a page, edit it, and save; others browse, search, and occasionally need to see who changed what last week or roll a page back after a bad edit.

Requirements

  • Create, read, edit, move and delete pages arranged in a tree within a workspace.
  • Keep every saved revision with author and time, show diffs, and restore any old revision.
  • Permissions are set on a page and inherited by its subpages unless a subpage overrides them.
  • Two people saving the same page must never silently overwrite each other's changes.
  • Search page titles and content within a workspace.

Constraints and assumptions

  • 2 million monthly active users across 50,000 workspaces; 5 million pages in total.
  • 200,000 page saves a day and 20 million page views a day; average page 20 KB.
  • Page trees are at most about 10 levels deep; a large workspace has 100,000 pages.
  • Search must never return a page the user cannot open, and new saves should be searchable within 1 minute.
  • Revisions are kept forever.

Out of scope for the first sketch

Real-time co-editing with live cursors · Comments and notifications · File attachments

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches