Git Product home page Git Product logo

microservice_in_python's Introduction

Demo project microservice in python with Kafka and Faust

Description

This is a demo project to represent a way to implement Python microservices with Kafka and Faust library.

Project structure

01_infrastructure

01_infrastructure - contains basic infrastructure described in docker-compose.yml file. Contains all infrastructure services such as:

  • Kafka
  • Zookeeper
  • Postgres
  • PgAdmin
  • Prometheus
  • Grafana

In .env file described all versions and ports required for the docker-compose.yml The grafana folder contains preconfigured dashboards and datasources required for this docker-compose.yml The prometheus folder contains preconfigured services to collect metrics by the prometheus service, required for this docker-compose.yml

02_demo_server

02_demo_server - contains demo server app and Dockerfile required to build it as docker image. The demo server produce random test data needed for demo.

03_data_requester

03_data_requester - contains data request microservice app and Dockerfile required to build it as docker image. The data requester service request data from demo server and send it to a Kafka.

04_data_processor

04_data_processor - contains data processor microservice app and Dockerfile required to build it as docker image. The data processor service read messages received from data requester via Kafka. Split data and upload to Kafka.

05_data_aggregator

05_data_aggregator - contains data aggregator microservice app and Dockerfile required to build it as docker image. The data aggregator service read messages received from data processor via Kafka. And calculate average value for last 10 responses.

06_db_loader

06_db_loader - contains db loader microservice app and Dockerfile required to build it as docker image. The db loader service read messages from data processor and data aggregator services and store this data to Postgres DB.

07_api_gateway

07_api_gateway - contains API gateway microservice app and Dockerfile required to build it as docker image. The api gateway service provide HTTP endpoints to request data from Postgres DB.

docker-compose.yml

docker-compose.yml - contains all services and infrastructure in one.

Requirements

  • Python 3.8+
  • Docker 20.10.8
  • Docker-compose 1.29.2

Python requirements

  • asyncio==3.4.3
  • aiohttp==3.7.4.post0
  • uvloop==0.15.3
  • fastapi==0.68.0
  • uvicorn[standard]==0.14.0
  • starlette==0.14.2
  • starlette-exporter==0.10.0
  • configloader==1.0.1
  • prometheus-client===0.11.0
  • PyYAML==5.4.1
  • asyncpg==0.23.0
  • SQLAlchemy==1.4.0
  • faust[rocksdb, fast, uvloop]==1.10.4

microservice_in_python's People

Contributors

krasnovvitaliy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.