To build an enterprise Kafka stream application in Python

With a high-frequency trading requirement, real-time and low-latency becomes the critical need in the trading system.

I was a software architect who involved to upgrade a legacy system into a real-time gambling trading system for a billion-sized business. Based on the maturity of using streams, new machine learning ideas were down to earth significantly. Today I want to share this five-year painful but worthy journey from Zero to Master on Kafka stream with python in this series. Besides the high-performance, the developing tips consolidate with stream system design, DevOps operation and quality assurance to build an enterprise python application.

There are eight sections of this series. It covers the concepts, patterns and architectures with five hands-on examples,

  • Get Started Stream Processing
  • Kafka Python Library Architecture
  • Stream Process Design Pattern
  • Stream Processing Operation
  • Building an Enterprise Application
  • Stream Application Test
  • Monitoring Stream Application
  • Stream System Capacity Design

Furthermore, to avoid the gap from concepts into practice. All five examples with machine learning libraries inspire all data scientists and engineers to transform their model and service into event-driven architecture faster and easier in action. In the meanwhile for business, to provide a new landscape to extend the uncovered business model with stream technology.  In this case, does business drive technology or technology drive business?

Like the Concorde airline, the business needed faster airline even in 1969, but there was no mature-ready technology to run at that moment.

So I applied real-time stream technology into exciting topics like an earthquake, stock market, chatbot, smart-price with example as following,

ExampleStream Design PatternDependencyKeywordsDescription
HelloWorldSingle-Event ProcessingStreamProducer, ConsumerSimple event processing
WordCountProcessing with local StateStream, Table, Web serviceState, expose state, web serviceSimple event processing with state
EarthquakeProcessing with external lookupMysql, HttpClient, Cron jobs, Timers, de/serialization/, schema registerExternal db, api, partitions, gisui, message serialisation/deserilaztionSimple earthquake data in realtime GIS-UI
StockMarketMultiphase processing/repartitioningStream, Table, Batch-Training, Real-time recommendationExternal api, batch-training, real-time recommendation, logs, monitoringSimple stock market recommendation system
FraudDetectionMultiphase processingStream, Table, Juypter notebook, autoMLWindows, Real-time prediction, metrics, autoMLSimple fraud detection in insurance claim
ChatbotMultiphase processingReal-time Web & Websocket, NLP rasa, spacyNLP, Real-time responseSimple NLP process and response in real-time
SmartPriceMultiphase processingIncremental learning model,Feature Store, Incremental learning modelSimple incremental learning model

In the end, this series is helping you to build confidence in adopting the steam-system, to choose a different stream design pattern, to avoid some apparent traps, to design your first stream production-ready and enterprise-ready application in python. Let’s shift stream technology into new business models.

Posted in

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.