Skip to content

Notion — Detailed#

flowchart TB
  subgraph Clients
    WEB
    MOB
    DESK[Desktop]
  end

  subgraph Edge
    LB
    WS[WebSocket gateway]
  end

  subgraph Core
    BLK[Block Service<br/>everything is a block]
    PARENT[Tree maintenance<br/>parent / children pointers]
    DBV[Database / View Service<br/>tables, kanban, calendar]
    PROPS[Property types]
    PERMS[Permissions inherited from parent]
  end

  subgraph Sync[Sync engine]
    REC[Record transactions]
    QU[[Per-record ops queue]]
    OFFLINE[Offline ops]
    SYNC([Sync engine reconcile])
  end

  subgraph Storage
    PG[(Postgres - blocks as rows)]
    META[(Workspace metadata)]
    FILES[(Files / S3)]
    SEARCH[(Search index)]
  end

  subgraph Features
    COMM[Comments / mentions]
    REM[Reminders / notifications]
    TPL[Templates]
    AI[Notion AI]
    SYNCED[Synced blocks across pages]
  end

  Clients --> Edge --> Core --> Storage
  Sync --- Core
  Features --- Core

    classDef client fill:#dbeafe,stroke:#1e40af,stroke-width:1px,color:#0f172a;
    classDef edge fill:#cffafe,stroke:#0e7490,stroke-width:1px,color:#0f172a;
    classDef service fill:#fef3c7,stroke:#92400e,stroke-width:1px,color:#0f172a;
    classDef datastore fill:#fee2e2,stroke:#991b1b,stroke-width:1px,color:#0f172a;
    classDef cache fill:#fed7aa,stroke:#9a3412,stroke-width:1px,color:#0f172a;
    classDef queue fill:#ede9fe,stroke:#5b21b6,stroke-width:1px,color:#0f172a;
    classDef compute fill:#d1fae5,stroke:#065f46,stroke-width:1px,color:#0f172a;
    classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1px,color:#0f172a;
    classDef external fill:#fce7f3,stroke:#9d174d,stroke-width:1px,color:#0f172a;
    classDef obs fill:#f3e8ff,stroke:#6b21a8,stroke-width:1px,color:#0f172a;
    class WS edge;
    class DESK,BLK,PARENT,PROPS,PERMS,REC,OFFLINE,COMM,REM,TPL,AI,SYNCED service;
    class DBV,PG,META,SEARCH datastore;
    class QU queue;
    class SYNC compute;
    class FILES storage;

Block model#

  • Everything (page, paragraph, todo, image, db) is a block with id, parent_id, type, properties, content[].
  • Tree edits cascade in deterministic order; permissions inherited.

Sync engine#

  • Optimistic local writes; reconciliation on sync.
  • Conflict resolution mostly LWW per property; tree structure uses parent-aware merge.

Glossary & fundamentals#

Concepts referenced in this design. Each row links to its canonical page; the tag column shows whether it is a high-level (HLD) or low-level (LLD) concept.

Tag Concept What it is Page
HLD Realtime protocols WS / SSE / polling / gRPC streaming realtime-protocols