Read-heavy datastore without a cache

warningread-heavy-path-without-cache

The design states a read-heavy workload and application servers read this datastore directly, yet the design has no cache anywhere. Every read pays a database round trip.

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

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

  • — all of these hold:
  • — the design requirement `traffic.readWriteRatio` is a number greater than 10
  • — the node has at least one synchronous incoming edge from an app-server
  • — this does not hold:
  • — the design contains a node of kind cache
Message
Datastore '{{node.id}}' serves a read-heavy workload directly from application servers and the design has no cache.

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

Applies to · 123 components
Tripped by · 1

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
# The design states a read-heavy workload and application servers read this datastore
# directly, yet no cache exists anywhere in the design. Every read pays a database round trip.
# Tripped by: designs/object-storage.broken.yaml
schemaVersion: "1"
type: "rule"
id: "read-heavy-path-without-cache"
severity: "warning"
select:
  node:
    kind: ["sql-database", "nosql-database"]
when:
  all:
    - requirement: "traffic.readWriteRatio"
      gt: 10
    - hasEdge:
        direction: "in"
        mode: "sync"
        peerKind: "app-server"
    - not:
        hasNode:
          kind: "cache"
message: "Datastore '{{node.id}}' serves a read-heavy workload directly from application servers and the design has no cache."

The same page as markdown, for an agent: /catalogue/rules/read-heavy-path-without-cache.md