{
  "id": "bbg-p0191-api-gateways-and-contracts-api",
  "title": "Distributed Counter Service Flow",
  "chapter": "backend-service-architecture",
  "batch": "06",
  "rank": 57,
  "sourcePage": 191,
  "sourcePointer": "p. 191",
  "status": "accepted",
  "reviewerStatus": "reviewed",
  "fidelityScore": 0.9,
  "canvas": {
    "width": 960,
    "height": 640
  },
  "fireworksTechGraph": {
    "style": "style-1-flat-icon",
    "diagramType": "data-flow",
    "topologyNotes": [
      "source page render inspected",
      "extracted page text inspected",
      "source page render inspected",
      "preserve distributed-counter topology: client API layer, idempotent event logging, time-series storage, rollup queues, aggregation windows, Cassandra store, cache, and read refresh",
      "retargeted from API chapter to backend-service-architecture"
    ],
    "publicBoundary": [
      "original vector output",
      "no source pixels",
      "no source mark or long wording"
    ]
  },
  "callouts": [
    {
      "label": "Read path serves hot counter values from cache.",
      "x": 650,
      "y": 492
    }
  ],
  "sourceReview": {
    "conceptAnchors": [
      "concept: client API layer",
      "concept: event idempotency",
      "concept: rollup queues",
      "concept: Cassandra rollup store",
      "concept: EVCache reads"
    ],
    "labelSource": "curated",
    "semanticStatus": "reviewed"
  },
  "groups": [
    {
      "id": "api",
      "label": "Client API",
      "x": 54,
      "y": 118,
      "w": 190,
      "h": 330
    },
    {
      "id": "write",
      "label": "Write and rollup",
      "x": 302,
      "y": 118,
      "w": 330,
      "h": 330
    },
    {
      "id": "read",
      "label": "Read optimization",
      "x": 690,
      "y": 118,
      "w": 216,
      "h": 330
    }
  ],
  "shapes": [
    {
      "id": "client",
      "kind": "actor",
      "label": "Counter client",
      "detail": "add get clear",
      "x": 94,
      "y": 176,
      "w": 82,
      "h": 88,
      "tone": "blue"
    },
    {
      "id": "gateway",
      "kind": "gateway",
      "label": "Data gateway",
      "detail": "route request",
      "x": 92,
      "y": 320,
      "w": 118,
      "h": 80,
      "tone": "orange"
    },
    {
      "id": "events",
      "kind": "queue",
      "label": "Event log",
      "detail": "event IDs",
      "x": 334,
      "y": 166,
      "w": 126,
      "h": 54,
      "tone": "purple"
    },
    {
      "id": "buckets",
      "kind": "cylinder",
      "label": "Time buckets",
      "detail": "partitioned",
      "x": 482,
      "y": 150,
      "w": 126,
      "h": 78,
      "tone": "teal"
    },
    {
      "id": "rollup",
      "kind": "queue",
      "label": "Rollup queue",
      "detail": "batch",
      "x": 334,
      "y": 306,
      "w": 126,
      "h": 54,
      "tone": "orange"
    },
    {
      "id": "store",
      "kind": "cylinder",
      "label": "Rollup store",
      "detail": "Cassandra",
      "x": 482,
      "y": 290,
      "w": 126,
      "h": 78,
      "tone": "green"
    },
    {
      "id": "cache",
      "kind": "cylinder",
      "label": "Read cache",
      "detail": "hot counters",
      "x": 738,
      "y": 170,
      "w": 126,
      "h": 78,
      "tone": "teal"
    },
    {
      "id": "refresh",
      "kind": "rect",
      "label": "Background rollup",
      "detail": "refresh stale",
      "x": 738,
      "y": 324,
      "w": 126,
      "h": 58,
      "tone": "gray"
    }
  ],
  "connectors": [
    {
      "from": "client",
      "to": "gateway",
      "label": "request",
      "flow": "main"
    },
    {
      "from": "gateway",
      "to": "events",
      "label": "write",
      "flow": "async"
    },
    {
      "from": "events",
      "to": "buckets",
      "label": "partition",
      "flow": "data"
    },
    {
      "from": "events",
      "to": "rollup",
      "label": "batch",
      "flow": "async"
    },
    {
      "from": "rollup",
      "to": "store",
      "label": "aggregate",
      "flow": "data"
    },
    {
      "from": "store",
      "to": "cache",
      "label": "serve",
      "flow": "data"
    },
    {
      "from": "refresh",
      "to": "store",
      "label": "stale fix",
      "flow": "control",
      "dashed": true
    }
  ]
}
