---
id: "stateful-engine-pinned-to-single-zone"
type: "rule"
severity: "error"
url: "https://localhost:3000/catalogue/rules/stateful-engine-pinned-to-single-zone"
---

# Stateful engine pinned to a single zone

A matching engine, coordination service or event store sits in exactly one availability zone with no failover or replication.

| | |
|---|---|
| Severity | error |
| Selects | every node of kind matching-engine, coordination-service or event-store |
| Components in scope | 26 |

## Why

A matching engine, coordination service or event store living in exactly one availability zone, with no failover and no replication, is lost with that zone. Everything that depends on it stops with it.

## What it checks

It looks at every node of kind matching-engine, coordination-service or event-store, and fires when:

- all of these hold:
  - the node sits inside exactly 1 availability-zone group
  - any of these hold:
    - the node's `failover` is "none"
    - the node's `replicated` is false
    - the node's `replication` is "none"

Message template:

```
'{{node.id}}' is pinned to a single availability zone with no failover or replication.
```

## Applies to

- [Coordination service](https://localhost:3000/catalogue/kinds/coordination-service.md) `coordination-service`
- [Event store](https://localhost:3000/catalogue/kinds/event-store.md) `event-store`
- [Matching engine](https://localhost:3000/catalogue/kinds/matching-engine.md) `matching-engine`

26 catalogue components fall under it.

## Tripped by

Reference designs whose broken twin names this rule in its header:

- [coinbase-exchange](https://localhost:3000/d/zeema/coinbase-exchange)
- [digital-wallet](https://localhost:3000/d/zeema/digital-wallet)
- [dropbox-sync](https://localhost:3000/d/zeema/dropbox-sync)
- [etsy-search](https://localhost:3000/d/zeema/etsy-search)
- [figma-multiplayer](https://localhost:3000/d/zeema/figma-multiplayer)
- [object-storage](https://localhost:3000/d/zeema/object-storage)
- [unique-id-generator](https://localhost:3000/d/zeema/unique-id-generator)

## Source (`rule` YAML, verbatim)

```yaml
# yaml-language-server: $schema=../schema/rule.schema.json
# A matching engine, coordination service or event store that lives in exactly one
# availability zone with no failover or replication is lost with that zone, and everything
# that depends on it stops. Tripped by: designs/object-storage.broken.yaml
schemaVersion: "1"
type: "rule"
id: "stateful-engine-pinned-to-single-zone"
severity: "error"
select:
  node:
    kind: ["matching-engine", "coordination-service", "event-store"]
when:
  all:
    - inGroup:
        kind: "availability-zone"
        count:
          eq: 1
    - any:
        - prop: "failover"
          equals: "none"
        - prop: "replicated"
          equals: false
        - prop: "replication"
          equals: "none"
message: "'{{node.id}}' is pinned to a single availability zone with no failover or replication."
```

Human page: https://localhost:3000/catalogue/rules/stateful-engine-pinned-to-single-zone
