Event Streaming with Kafka

Project Building an Event Driven System

Architecture Overview of Event Driven System

In this guide, you’ll learn how to design and implement an end-to-end event-driven architecture for an e-commerce application using Apache Kafka. We’ll translate the user journey into a technical solution, covering the flow from order placement to warehouse processing.

User Journey

  1. A customer launches the web UI and browses products.
  2. They add items to the cart and place an order.
  3. The application emits an OrderPlaced event to a Kafka topic.
  4. A warehouse dashboard consumes the event in near real time.
  5. Warehouse staff pack and ship the order.

Note

In a production environment, you might add services like fraud detection, inventory management, or analytics that subscribe to the same Kafka topic for parallel processing.

System Architecture

The image illustrates an event-driven system where a shopping application places an order, triggering events that are processed by a Kafka topic and then sent to a warehouse dashboard.

Components Breakdown

ComponentRoleDetails
Web Application (Producer)Publishes events to KafkaFlask-based UI in Python sends OrderPlaced messages.
Apache KafkaEvent backbone & message busStores, replicates, and streams events across multiple topics.
Warehouse Dashboard (Consumer)Consumes and displays eventsSubscribes to the Kafka topic and renders new orders in real time.

Technology Stack

LayerTechnology
BackendPython, Flask
MessagingApache Kafka
InfrastructureAWS EC2
FrontendHTML, CSS
Development IDEVisual Studio Code

Next Steps: Deploying Kafka on AWS EC2

  1. Launch an EC2 instance with Java installed.
  2. Download and extract the latest Kafka release.
  3. Configure server.properties (broker ID, listeners, log directories).
  4. Start Zookeeper and Kafka broker services.
  5. Test end-to-end by producing and consuming sample OrderPlaced events.

Warning

Ensure your EC2 security groups allow inbound traffic on Kafka’s default ports (9092 for clients, 2181 for ZooKeeper) and restrict access to trusted IPs only.

References

Watch Video

Watch video content

Previous
Demo Kafka Connect in Action