Skip to content

CONCEPT Cited by 2 sources

Object-tree document model

An object-tree document model represents a document as a rooted tree of objects, each with a stable ObjectID and a bag of (Property, Value) entries. It's the data-model choice behind the HTML DOM, the Figma file format, every major design tool, and most real-time-collaboration systems over structured content.

The reduction Figma articulates in its 2019 multiplayer post (Source: sources/2019-figma-how-figmas-multiplayer-technology-works):

  • Two-level map: Map<ObjectID, Map<Property, Value>>.
  • Database-row view: tuples of (ObjectID, Property, Value) — each triple is one editable fact.
  • Tree shape: hierarchy of parent → children edges on top of the map (parent-ID property, or a children-list property on the parent).

Figma: root document → page objects → page-content subtrees (presented as the left-panel layers in the editor).

Why this shape matters for collaboration

The model has three load-bearing consequences for any real-time collaboration system built on top of it:

  1. Feature velocity compounds on the schema. "Adding new features to Figma usually just means adding new properties to objects." The schema is open-extension — new capabilities don't require data-model migrations, only new property keys. This is why Figma could keep shipping features on the same multiplayer substrate through 2024 without redesigning the sync model.

  2. Property-granular conflict resolution. Because state is decomposed to (ObjectID, Property, Value) triples, concurrent edits to different properties of the same object never conflict — they commute trivially. Concurrent edits to the same (ObjectID, Property) are the only coordination point, and they're resolvable with per-property CRDTs like LWW-register.

  3. References as first-class edges. Property values can be ObjectIDs — instance → component, auto-layout frame → contained-child, style → shared-style-source. Those property-valued references are what QueryGraph later indexes as the edges of Figma's dependency graph. The 2019 data model is the graph's vertex set.

Compared to sibling data models

Model Shape Concurrency story
Linear text char[] OT; offsets shift under inserts/deletes
Object tree Map<ID, Map<Prop, Val>> + parent edges Per-property CRDTs; references don't break under concurrent edits
JSON doc tree Nested ordered maps + arrays Per-path CRDTs (Automerge, Yjs); list-CRDTs for arrays
Relational rows Table × PK × column Row-level LWW + FK constraints; real-time usually bolted on

Seen in

Last updated · 200 distilled / 1,178 read