Leaderboard & Counting Service  ·  View 07 of 21  ·  Structure

Layered Architecture

Six layers, and the one dependency the request path is allowed to have.

Editable source SVG draw.io All views
Experience Mobile app Web app Tenant console Trust & safety console Edge Global load balancer anycast Edge policy Cloud Armor Token verification Identity Platform Service Counting API Query API Admission dedup, shard, hold Config API Processing Aggregation Dataflow streaming Projection builder Season closer Rebuild runner replay ≥ 10× State Event log Pub/Sub Bucket + ranked store Bigtable Rank cache Memorystore Control plane store Spanner Event archive Cloud Storage Platform Workload identity Key management event signing Observability lag, shards, cost Warehouse export BigQuery ack on durable top-N, rank merge deltas replay Leaderboard & Counting Service — Layered Architecture External / third party Application we own Interface / broker Security / platform Queue / topic Data store synchronous event / async batch Processing sits below Service deliberately: nothing in the request path waits on it. The only synchronous dependency of an accepted write is the event log. v 1.0 · owner Platform Architecture · date 2026-10

Decisions

  • Processing sits below Service deliberately. Nothing in the request path waits on aggregation, projection or the season closer; the only synchronous dependency of an accepted write is the event log.
  • State is one layer but five stores with three different recovery stories — log, projections, cache — and the layer diagram is the first place that split is visible.
  • The rebuild runner is a first-class component in the Processing layer, not a runbook.

Reading the layers

  • Edge carries everything a counting event must survive before it is believed: TLS, token, signature, rate limit, bot score.
  • Platform holds what the architecture needs but the product never calls: identity, keys, observability, export.

Deliberately omitted

  • Every observability edge, which would otherwise touch all six layers and tell the reader nothing.
  • The tenant console's own API surface, shown on view 09.