Module 17 / Event-driven data and streaming

Module 17 · lesson 8 of 8 · Lab 18 min

Lab: Live restaurant dashboard

Orders per minute and prep times, updated live.

Restaurant owners keep calling Tiffin's partner team with the same question: "Are we slow tonight, or is it just busy?" They want to see it for themselves, live, on the kitchen tablet and on their laptop at home.

In this lab you'll design that dashboard using the tools from this module. As before, decide each step yourself before reading on.

The brief

The partner team's product manager gives you this:

Show each restaurant, updated live:

  1. Orders per minute for the last 60 minutes, as a bar chart.
  2. Average prep time (from "accepted" to "ready") over the last 30 minutes.
  3. Right now: how many orders are waiting to be accepted, being cooked, and ready for pickup.

Numbers you're given:

  • 60,000 restaurants across 40 cities.
  • 4 million orders a day, 60% of them in the 3-hour dinner rush.
  • Each order produces about 8 events (placed, accepted, ready, rider assigned, picked up, delivered, and so on).
  • Up to 15,000 dashboards open at once at peak.
  • Numbers on screen should be no more than about 10 seconds old.
  • Order events are already published to a Kafka topic, order-events, keyed by order_id (you built this in the Module 15 lab).

This is a display for humans. It must be roughly right and fresh. It is not used for money.