java, system design, real-time systems, kafka,

Dashflow – Reactive Order Assignment System

Pritesh Kamde Pritesh Kamde Follow Jan 01, 2025 · 1 min read
Dashflow – Reactive Order Assignment System
Share this

Dashflow – Reactive Order Assignment System

A DoorDash-style real-time backend for batching and assigning food delivery orders using Spring Boot WebFlux, Kafka, and Project Reactor.


🧩 Problem Statement

Food delivery platforms like DoorDash need to efficiently group and assign high volumes of incoming orders while minimizing delays and driver overhead.

However:

  • Orders arrive continuously and unpredictably
  • Naive one-order-per-runner logic creates inefficiencies
  • Delays in assignment hurt both customers and restaurants

❓ Why Are We Solving This?

Let’s say:

  • 🧍‍♂️ Person A (in ZIP 85719) orders from Domino’s
  • 🧍‍♀️ One minute later, Person B (same ZIP) orders from Burger King — close to Domino’s

Instead of dispatching two drivers, we batch the orders and assign them to one runner, saving time and cost.


🎯 Goal

Design a backend system that simulates real-time:

  • Order ingestion
  • Batching by delivery zone
  • Assignment to delivery runners
  • Routing logic for efficient chunked dispatching

🛠 Tech Stack

Component Tool/Framework
Reactive Backend Spring Boot WebFlux
Event Streaming Apache Kafka
Reactive Streams Project Reactor
Batching & Assignment Custom Zone-Aware Logic
Deployment Localhost via Docker/Kafka

🧪 Working

  1. Orders are sent in real time via REST (/orders)
  2. Orders are streamed through Kafka
  3. Orders are buffered and batched by ZIP code (zone)
  4. Assignment logic runs on a schedule (e.g., every 60 seconds)
  5. Chunked orders are assigned to available runners

✅ Result

  • Achieved 2× faster dispatch times by reducing latency
  • Enabled zone-based batching for grouped deliveries
  • Simulated real-world delivery routing scenarios
  • Laid the foundation for a scalable food delivery backend

▶️ Running the Project

  1. Clone the repo
  2. Start Kafka with Docker:
docker-compose up -d

./gradlew bootRun

curl -X POST http://localhost:8080/orders \
  -H "Content-Type: application/json" \
  -d '{"restaurantId": "r1", "customerAddress": "123 Main St", "zone": "85719", "estimatedPrepTime": 10}'

Join Newsletter
Get the latest news right in your inbox. We never spam!
Pritesh Kamde
Written by Pritesh Kamde Follow
I’m Pritesh Kamde, a Full Stack Software Engineer with a Master’s in Information Systems from the University of Arizona (Eller College) and 3 years of experience building scalable fintech systems at Barclays. My background spans Java, Spring Boot, React, Python, Node.js, and cloud platforms like AWS and GCP. At Barclays, I designed enterprise-grade APIs and real-time dashboards for retail banking and credit systems. I’ve also worked across the MERN stack to consolidate internal tools for workforce planning. With a foundation in both backend engineering and front-end architecture, I enjoy building secure, high-performance systems that solve real business problems. Outside of work, I’ve served as a Graduate Assistant and certified tutor, mentoring students in business and tech courses. I’m passionate about creating software that drives impact—whether through data-driven platforms, seamless user experiences, or automating workflows. Currently open to full-time opportunities where I can contribute to high-growth teams driving innovation in finance, AI, or cloud-native platforms.