Status: Accepted (in force). Reconstructed.

Context

The org chart is read often (dashboards, Performance reviews, reporting) and changes rarely (only when a ManagerId changes). Computing the full tree on every read — recursively walking ManagerId for thousands of employees — is expensive.

Decision

Materialise the tree into container rows via OrganisationChartContainers_Trigger. When manager links change, the trigger rebuilds the materialised chart; reads hit the pre-computed containers.

Consequences

Good: cheap, fast reads; consumers get a ready tree.

Bad / costs: a write-time cost on manager changes; the materialised view can lag or go stale after bulk changes (a runbook scenario); cycles in ManagerId (A→B→A) can corrupt the tree and must be guarded.

Alternatives

Related

technical §16, runbook §1.