» Python: Building Event-Driven Microservices with Kafka » 1. Introduction » 1.1 Preparation

Preparation

Install Python

See How to install Python?.

Note: This project uses Python 3.12.2 and pip 24.0 for Python 3.12.

Pick an editor

Pick your favorite editor or use Visual Studio Code.

Learn Python basics

If you're not familiar with Python, you may try this tutorial: "Quick Introduction to Python."

What is an Event-Driven Architecture

See https://aws.amazon.com/event-driven-architecture/.

How it works: example architecture

Figure. How it works: example architecture from https://aws.amazon.com/event-driven-architecture/

Apache Kafka

kafka logo

Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.

FastAPI web framework

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.

Miminal example:

from typing import Union

from fastapi import FastAPI

app = FastAPI()


@app.get("/")
def read_root():
    return {"Hello": "World"}


@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
    return {"item_id": item_id, "q": q}
Next