Skip to content

Part 7 · Blueprint 44

Graph Database & Authorization Engine (Google Zanzibar / Meta TAO)

14 min reading · Sources · Editorial review pending

A stale permission result can disclose a new document after access was revoked.

More
20px
Reading list
Page details

Published date · Last edited:

Draft edition. Editorial review and supplementary reading recommendations are still being completed.

Format: Architecture walkthrough. Prerequisites: the beginner bootcamp. Chapter prerequisites: Consistency Models: CAP, PACELC & Linearizability, Security Architecture, Zero-Trust & Multi-Tenancy.

Sixty-second mental model

Problem: A stale permission result can disclose a new document after access was revoked.

Use: Carry a freshness boundary into graph expansion and caching.

Design boundary: Evaluate relationship-based permissions over versioned authorization facts. Graph traversal and database graph storage are related but do not alone define a safe authorization service.

Layer 1 · Intuition

Hypothetical scenario: Northwind is designing relationship authorization. Maya represents product requirements, Dev implementation and Priya reliability. The team must agree what one permission check means and which component owns the relationship graph revision.

Think of a permission desk following membership and folder relationships. Separate the requester from relationship graph revision, then identify the retained evidence needed after failure.

Authority
The entitled state owner.
Invariant
A rule preserved across concurrency and failures.

Architecture and worked reasoning

Design boundary: Evaluate relationship-based permissions over versioned authorization facts. Graph traversal and database graph storage are related but do not alone define a safe authorization service.

Responsibilities on the request path

Relationship authorization: responsibilities and request directionEvaluate relationship-based permissions over versioned authorization facts. Graph traversal and database graph storage are related but do not alone define a safe authorization service.Relationship tuplesPolicy versionPermission evaluatorDecision cache
Evaluate relationship-based permissions over versioned authorization facts. Graph traversal and database graph storage are related but do not alone define a safe authorization service.

Workload and limiting resource

Hypothetical membership traversal has branching factor 5 and depth 4. A naive full traversal can inspect 1 + 5 + 25 + 125 + 625 = 781 nodes before deduplication. Memoization helps repeated subproblems but must include policy and relationship versions.

Keep the units attached to each intermediate result. The assumptions above describe a hypothetical exercise, not observed vendor capacity. A real capacity decision also needs a measured service curve, skew, recovery traffic and an explicit admission policy for overload.

Mutation or publication path

Relationship authorization: mutation boundaryAuthorize tuple/policy mutations. Then: Commit a version that can be referenced by decisions. Then: Invalidate or version cached permissions.Step 1
Authorize tuple/policy mutations.
Step 2
Commit a version that can be referenced by decisions.
Step 3
Invalidate or version cached permissions.
Authorize tuple/policy mutations. Then: Commit a version that can be referenced by decisions. Then: Invalidate or version cached permissions.
  1. Authorize tuple/policy mutations.
  2. Commit a version that can be referenced by decisions.
  3. Invalidate or version cached permissions.

Observation and recovery path

Relationship authorization: observation boundaryEvaluate the requested relation within tenant/resource scope. Then: Bound recursion and detect cycles under the policy language. Then: Honor freshness requirements after revocation.Step 1
Evaluate the requested relation within tenant/resource scope.
Step 2
Bound recursion and detect cycles under the policy language.
Step 3
Honor freshness requirements after revocation.
Evaluate the requested relation within tenant/resource scope. Then: Bound recursion and detect cycles under the policy language. Then: Honor freshness requirements after revocation.
  1. Evaluate the requested relation within tenant/resource scope.
  2. Bound recursion and detect cycles under the policy language.
  3. Honor freshness requirements after revocation.

Failure that changes the decision

Hypothetical scenario: A stale cached allow survives removal from a group. Define the required revocation consistency boundary and carry version evidence through cache use.

Attempt this decision before reading the explanation

Can a cached allow be treated the same as a cached public document?

No. Permission staleness can disclose protected data. Its validity must follow the authorization contract, including revocation and policy revision.

Supporting mechanism analysis

Hypothetical scenario: Northwind. Maya represents product, Dev implementation and Priya reliability. The following workflow develops the underlying mechanism.

Hypothetical scenario. Northwind’s context selection passes its example questions. During a policy update, Maya receives a new rule with an old exception. Dev’s writes all succeeded, but Priya cannot identify a single accepted revision behind the answer.

You will trace source identity, derived representations, permission changes and deletion through one evidence lifecycle. Separate successful writes from the application decision that makes a complete revision eligible for readers.

Before you continue: All replacement writes succeeded individually. Does that prove every concurrent answer used one coherent revision?

Those results describe individual operations. They do not establish which mixture a request observed or whether older queued work can restore retired data.

This makes the publication decision inspectable. Prepare and validate the replacement, track dependent copies and prevent stale work from reintroducing an ineligible revision.

The ingestion design needs a publication boundary. Identify which complete source and representation revision a request may use, and how that decision remains visible during retrieval and answer construction. A successful database write establishes only that operation's result, not that every dependent representation and cache now agrees.

A stable source identity refers to the same logical document across edits. A revision identifies a particular accepted source state. Parsing produces a derived artifact with its own transformation identity, and chunking creates children tied to that source revision. An embedding adds the encoder and preprocessing identity needed to interpret its vector.

Changing the parser or chunker can require rebuilding derived content even when the source text is unchanged. Changing the embedding model can require a representation migration. Preserve these distinctions in the manifest so an operator can answer which text and transformation produced a returned passage.

A content digest can detect whether bytes match an expected artifact. It does not by itself tell which artifact is authoritative or whether the caller may access it. Obtain source and revision authority from the defined source catalog and access policy, then use integrity checks to verify the corresponding material.

Hypothetical scenario. Document D revision 12 produces a complete expected child set. Build and verify those children before a conditional source manifest selects them. A delayed revision-11 event cannot republish its retired chunks after that pointer moves.

Deletion spans vector and lexical indexes, parent passages, summaries and response caches. Track each obligation or require a current source check that prevents obsolete disclosure. A collector must not delete children still eligible for publication or needed by a supported rollback. Snapshot-plus-change capture needs an explicit boundary so an update accepted during a rebuild is neither lost nor applied under the wrong transform version.

One useful design builds the new representation under a distinct revision, checks its completeness and quality, then changes an application-owned accepted-version record. Retrieval selects only revisions allowed by that record. The design needs explicit behavior if a worker sees a new record before the corresponding artifacts are available.

A request that needs several passages from the same policy should retain a coherent accepted revision while building its answer. If authorization or a required source version changes during execution, define whether to restart, reject or revalidate. Consistency and freshness are task choices that need visible boundaries rather than a vague promise of “real time.”

Hypothetical scenario. Begin with 100 documents, each represented by six chunks. The initial count is 100 × 6 = 600 chunks. Choose 12 documents to revise, three other documents to delete and 85 to leave unchanged. The groups sum to 12 + 3 + 85 = 100.

Suppose each revised document now produces eight chunks. New chunks for those revisions total 12 × 8 = 96. Their old children total 12 × 6 = 72, and deleted documents contribute another 3 × 6 = 18 old children. Once the replacement view is accepted and retired children are excluded, the selected current count is 600 − 72 − 18 + 96 = 606 chunks.

The same result follows directly from retained content: 85 × 6 + 12 × 8 = 510 + 96 = 606. The current source count is 85 + 12 = 97 documents. An incremental build encodes the selected 96 new chunks rather than rebuilding all 606, assuming the unchanged representation pipeline remains compatible.

These counts do not include temporary coexistence, replicas, metadata or cache dependencies. During preparation, old and new children can both occupy storage even when only one revision is readable. Derive a separate staging peak rather than treating the final active count as the largest allocation.

Queue delivery can be duplicated or delayed. Define an operation identity and compare an incoming update with the authoritative accepted source state. If revision four is current and a delayed revision-three event arrives, processing it must not make revision three active again merely because it arrived later.

A wall-clock timestamp is not automatically a trustworthy revision order. Clocks, connectors and source systems can disagree. Use the source's defined version or an application-owned ordering contract, and specify how conflicting or incomparable revisions are handled. Do not invent a global order across unrelated sources when the application only needs per-source sequencing.

Repeated processing should be safe under that contract. Stable operation and artifact identities can prevent duplicate children or repeated publication. Idempotent storage calls help, but they do not resolve a disagreement about which revision should be accepted.

A small child chunk can be useful for matching a query while its parent section supplies interpretation. Store the parent-child relationship under the same source and revision identity. Expanding a matched child should not attach a parent from an older parse simply because the section title remained similar.

A source revision can change the number and shape of children. Do not assume that positional chunk number five denotes the same content after reflow or a new parser. Use identities that distinguish revision-specific children and retain enough source mapping to explain a citation.

Removing a source from the accepted catalog should immediately affect which evidence the application considers usable under its policy. Physical deletion from vector storage, parsed artifacts, response caches, replicas and retained diagnostics can follow different mechanisms. Inventory them and define completion evidence rather than treating one database delete as the whole operation.

Layer 3 · Internals

Relationship-based authorization represents facts such as a user belonging to a group and that group holding viewer access to a document. A permission check can recursively follow those relations. The graph's shape affects fan-out, cycle handling, cache keys and the maximum acceptable query work. A boolean result needs the revision and policy under which it was obtained if later operations depend on its freshness.

Consider a hypothetical user removed from a group before new confidential content is published. A stale membership cache combined with fresh content can disclose material the user should never see. Require the check to observe at least the revision representing removal, and propagate the necessary consistency token with the protected operation. Merely shortening a cache TTL leaves an exposure window. Cache scope must include the subject, object, permission and relevant policy/revision context. A successful graph lookup is also not permission to enumerate arbitrary related objects; list and check interfaces need equivalent disclosure boundaries.

Trade-offs and limits

ApproachProvidesRequires
Revision-bound permission checkCan require observation of a known policy update.May wait for an eligible replica or return unavailable.
Bounded-staleness cacheReduces repeated graph work for a declared window.Revocation exposure must fit the product's explicit policy.

Recovery decision

Hypothetical scenario: A stale cached allow survives removal from a group. Define the required revocation consistency boundary and carry version evidence through cache use.

No. Permission staleness can disclose protected data. Its validity must follow the authorization contract, including revocation and policy revision.

Write your design before revealing the review

Can a cached allow be treated the same as a cached public document?

Evidence you can explain in your own design

Drafts and self-review are stored only in this browser. They are separate from reading completion.

Compare your decision

No. Permission staleness can disclose protected data. Its validity must follow the authorization contract, including revocation and policy revision.

A stale cached allow survives removal from a group. Define the required revocation consistency boundary and carry version evidence through cache use.

Check your understanding

Can a cached allow be treated the same as a cached public document?

No. Permission staleness can disclose protected data. Its validity must follow the authorization contract, including revocation and policy revision.

How would you recover from this failure: A stale cached allow survives removal from a group. Define the required revocation consistency boundary and carry version evidence through cache use.

Start with the exact boundary that failed. Authorize tuple/policy mutations. Commit a version that can be referenced by decisions. Invalidate or version cached permissions. Then recover evidence through the observation path: Evaluate the requested relation within tenant/resource scope. Bound recursion and detect cycles under the policy language. Honor freshness requirements after revocation. Preserve the distinction between a confirmed state change and an unavailable response.

Which assumption in the worked calculation would a burst or concentrated tenant invalidate first?

Hypothetical membership traversal has branching factor 5 and depth 4. A naive full traversal can inspect 1 + 5 + 25 + 125 + 625 = 781 nodes before deduplication. Memoization helps repeated subproblems but must include policy and relationship versions. Recompute the affected resource rather than multiplying unrelated storage and network budgets by the same factor. Evaluate relationship-based permissions over versioned authorization facts. Graph traversal and database graph storage are related but do not alone define a safe authorization service.

Which component in this topology could be removed from a smaller first deployment?

Relationship tuples, Policy version, Permission evaluator, Decision cache name responsibilities, not a requirement for separate processes. Co-locate responsibilities when their transaction, trust and capacity boundaries permit it. Authorize tuple/policy mutations.

What evidence must a caller have before relying on the observation path?

Evaluate the requested relation within tenant/resource scope. Bound recursion and detect cycles under the policy language. Honor freshness requirements after revocation. No. Permission staleness can disclose protected data. Its validity must follow the authorization contract, including revocation and policy revision.

45-minute interview rubric

  1. 00–05: scope permission check and relationship graph revision.
  2. 05–12: identify the limiting resource and derive the domain workload above, retaining units and assumptions.
  3. 12–28: draw relationship graph revision, numbered writes and reads.
  4. 28–40: challenge recovery: Carry a freshness boundary into graph expansion and caching.
  5. 40–45: defend object placement, observations and remaining assumptions.

Go deeper

  • Consistency - Authzed Docs · Primary document · authzed.com. Carry a freshness boundary into graph expansion and caching. Verified 2026-10-26.
  • Points - Qdrant · Primary document · qdrant.tech. Carry a freshness boundary into graph expansion and caching. Verified 2026-10-26.

Decision log

Carry a freshness boundary into graph expansion and caching.

Preserve permission check identity and relationship graph revision ownership.

Revisit changed workload, observations or recovery objectives.