How this runs on Cloudflare
The original demo runs on Kubernetes with Tilt: Quarkus services, the Apollo Router, Kafka and Postgres. This Lunch & Learn runs the same domain, schemas, seed data and APIs as ten Cloudflare Workers.
| apollo-demo | Here |
|---|---|
| Apollo Router 2 + supergraph.graphql + timing.rhai | Router Worker running Hive Gateway over the same composed supergraph; it copies each subgraph's timing headers onto the response, as the Rhai script did, and records every subgraph call for the timelines |
| hr / employment / security subgraphs (Quarkus, SmallRye GraphQL) | Three Workers: GraphQL Yoga with @apollo/subgraph, the original SDL unchanged, including @key and @extends |
| Cluster DNS between router and subgraphs | Service bindings: Worker-to-Worker calls with no public network hop |
| Postgres databases (hr_db, employment_db, security_db, *_events_db, projections_db) | Seven D1 databases, one per original database |
| Event services with a transactional outbox (Quarkus, Panache) | Three Workers; entity row and outbox row commit in one D1 batch |
Outbox relay, @Scheduled(every = "1s") | An OutboxRelay Durable Object per service: woken by each write, then polls every second while rows wait |
| Kafka topics events.hr.person, events.employment.employee, events.security.badge | Three Cloudflare Queues |
| Projection consumer (SmallRye Reactive Messaging) | A queue consumer Worker; same snapshot upsert and processed-events idempotency. Propagation timing is stored in D1 for all three topics instead of in memory for persons only |
| Query service | A Worker over the projections D1 with the same composed view and freshness format |
kubectl scale … --replicas=0 | Per-visitor lesson switches: a request header for subgraph outages and latency, and a Lesson Durable Object for broker down and consumer paused |
| React dashboard (nginx) | These pages, served by the web Worker, which also forwards /api to the others |
What is different on purpose: every visitor gets their own session, so one person's outage or new hire never
shows up in anyone else's lesson. Seed people are shared and read-only, and anything you create is cleared after 20 minutes.
Latencies are Cloudflare's, not a laptop cluster's, so the absolute numbers differ from the original; the shapes are the same.