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
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
Datastore '{{node.id}}' serves a read-heavy workload directly from application servers and the design has no cache.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.
# 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."