Every morning, our 847 engineers face the same mission-critical question before their first stand-up: does the espresso machine on floor 3 still have beans? Until recently, answering it required walking 40 meters to the kitchen — a journey that, according to our people-analytics pipeline, costs us roughly 3,100 engineer-hours per year. Even worse, the incumbent solution was a shared spreadsheet with a staleness SLO of "lol, idk". When our CTO announced the Q3 OKR to "digitize the physical coffee domain with a cloud-native, hybrid, edge-first platform", the answer was obvious: HyperBean — a real-time bean telemetry platform that streams the sacred bean level into a Progressive Web App with a p99 latency of 480 ms, powered by Firecracker microVMs and a distributed computing fabric spanning two coffee kitchens, three availability zones and one internship program.

The Problem

Bean level is fundamentally a streaming problem. Beans are consumed as a continuous, bursty event stream with peak load on Mondays at 08:55. Any stale read can trigger the dreaded Empty Hopper Incident, which our incident tooling classifies as a SEV-2 with a mean time to grumbling of 90 seconds. Our requirements were non-negotiable:

High-Level Architecture

We designed HyperBean as a hybrid edge-cloud platform with four layers: sensing, consensus, ephemeral compute and experience. The data plane is fully event-driven, the control plane is fully declarative, and the coffee plane is fully monitored.

flowchart TD A["Load Cell + ESP32"] -->|"MQTT over mTLS"| B["Raspberry Pi Edge Gateway"] B --> C["Mosquitto Broker Cluster"] C -->|"Bridge"| D["Apache Kafka"] D --> E["Kafka Streams"] D --> F["Apache Flink"] E --> G["Cassandra Cluster 9 nodes"] F --> G F --> H["Elasticsearch"] G --> I["GraphQL API Gateway"] H --> I I --> J["Envoy + Istio Service Mesh"] J --> K["BeanCompute Operator"] K --> L["Firecracker microVM"] L -->|"gRPC over HTTP3"| J J --> M["Next.js Edge Renderer"] M --> N["Progressive Web App"]

Layer 1: Hybrid Edge Sensing

Each coffee machine is instrumented with a 50 kg load cell connected to an ESP32 via an HX711 ADC. The ESP32 runs a quantized TensorFlow Lite model that classifies bean consumption events from hopper vibration signatures with 97.3% accuracy, then publishes MQTT messages over mTLS to a Raspberry Pi 4 edge gateway (hostname: Gandalf). A redundant broker pair spanning both kitchens is bridged into our Kafka cluster using MirrorMaker 2, giving us a hybrid topology where the edge buffers locally for up to 72 hours if the cloud link goes down. Every message is enriched with metadata labels such as machine=espresso-3, floor=3 and vibe=monday.

Layer 2: Distributed Consensus for the Bean Truth

A single sensor is a single point of failure, so bean level is decided by a five-node Raft cluster of Raspberry Pis named Gandalf, Frodo, Samwise, Legolas and Gimli. Each node continuously weighs the hopper and proposes bean-level updates; a value only becomes the official Bean Truth once a quorum of three nodes agrees, which eliminates noisy sensor outliers through distributed computing instead of boring Kalman filters. The agreed value is written to etcd, streamed through Flink windows, and persisted in a nine-node Cassandra cluster with a replication factor of three — one row per machine, but the architecture is ready for millions. A nightly Spark job runs a MapReduce inventory reconciliation across all machines and publishes a shareholder-ready PDF.

Layer 3: Ephemeral Firecracker microVM Compute

We refuse to run our bean-level API as a long-lived process, because long-lived processes accumulate state and state accumulates risk. Instead, every single read request goes through our Kubernetes operator, which watches a custom BeanComputeRequest resource and provisions a fresh Firecracker microVM via firecracker-containerd. Inside the microVM, a Rust gRPC microservice connects to Cassandra, applies our physics model (Hooke's law, applied to beans), and returns the level. The microVM is then destroyed. This VM-per-request model gives us a 125 ms cold boot, cryptographic isolation between engineers who merely want coffee, and a beautifully flat utilization graph. The gateway exposes the result over GraphQL, fronted by Envoy with HTTP/3 and a WASM filter that strips bean data from responses of employees who have not completed coffee-safety training.

Layer 4: The Hybrid Progressive Web App

The frontend is a Progressive Web App built with Next.js and Workbox. It ships as a service-worker-cached, installable app with stale-while-revalidate caching, background sync and a CRDT layer (Yjs) so multiple engineers can collaboratively annotate events like "the machine is making a weird noise again". Push notifications fire via Firebase when the Bean Truth drops below 12%. Because connectivity at our offices is hybrid (fiber, 5G and one expensive satellite fallback), the PWA renders on the Next.js edge runtime and hydrates into a fully offline-capable client. If the five Raft nodes ever disagree by more than 5%, the platform escalates to our human-in-the-loop consensus layer: an intern receives a Slack DM with a QR code and visually confirms the bean level, which re-enters the stream through a dedicated Kafka topic.

A read therefore looks like this:

sequenceDiagram participant E as Engineer participant P as PWA Service Worker participant G as GraphQL Gateway participant O as BeanCompute Operator participant M as Firecracker microVM participant C as Cassandra E->>P: Open bean dashboard P->>P: Check Workbox cache P->>G: GET beanLevel G->>O: Create BeanComputeRequest O->>M: Boot Firecracker microVM M-->>O: Ready after 125 ms M->>C: Fetch Bean Truth C-->>M: level 0.73 M-->>G: gRPC response G-->>P: JSON payload P-->>E: Render with confetti

Observability

Every hop emits OpenTelemetry spans, from the HX711 interrupt handler to the CSS paint event, aggregated in a stack of Prometheus, Thanos, Mimir, Grafana, Loki, Tempo and a custom Rust service called BeanCortex that correlates bean latency with espresso quality scores. Our chaos pipeline unplugs a random sensor every Tuesday to keep the Raft cluster humble.

Results

HyperBean delivers bean telemetry at p99 = 480 ms with 99.99% availability and a monthly cloud bill of $14,200 — amortized by 3,100 recovered engineer-hours, with break-even projected for Q1 2029. Employee satisfaction with coffee infrastructure rose from 3.1 to 3.4 out of 10. Next quarter we plan to move the Raft quorum onto a blockchain, render beans with WebGPU, and evaluate a quantum-safe MQTT handshake. The future of coffee is distributed, hybrid and ephemeral — just like our microVMs.