Database updates not propagated to the search index

warningbusiness-updates-without-index-propagation

Application servers write this database and the design keeps a search index, but nothing captures the database's changes. The index then depends on the application writing to both places, and the two drift apart silently.

Severity
warning
Selects
every node of kind sql-database
Components in scope
76
What it checks

It looks at every node of kind sql-database, and fires when:

  • — all of these hold:
  • — the node has at least one synchronous incoming edge from an app-server
  • — the design contains a node of kind search-index
  • — this does not hold:
  • — the node has at least one outgoing edge to a change-data-capture
Message
Database '{{node.id}}' is written by application servers and the design has a search index, but no change-data-capture propagates its updates. Index writes rely on dual writes.

{{node.id}} style paths are filled in from the node, the edge or the design the finding is about.

Applies to · 76 components
Tripped by · 12

Reference designs whose broken twin names this rule in its header. The gate reads the same header, and fails when a rule no design trips.

Source
# yaml-language-server: $schema=../schema/rule.schema.json
# Application servers write this system of record and the design keeps a search index, but
# no change-data-capture leaves the database. Index updates then depend on dual writes from
# application code, which drift silently. Tripped by: designs/twitter-timeline.broken.yaml
schemaVersion: "1"
type: "rule"
id: "business-updates-without-index-propagation"
severity: "warning"
select:
  node:
    kind: "sql-database"
when:
  all:
    - hasEdge:
        direction: "in"
        mode: "sync"
        peerKind: "app-server"
    - hasNode:
        kind: "search-index"
    - not:
        hasEdge:
          direction: "out"
          peerKind: "change-data-capture"
message: "Database '{{node.id}}' is written by application servers and the design has a search index, but no change-data-capture propagates its updates. Index writes rely on dual writes."

The same page as markdown, for an agent: /catalogue/rules/business-updates-without-index-propagation.md