This is an example micro service built with Python as a hack day experiment.
- RESTful microservice
- API documentation in Swagger (OpenAPI)
- CQRS splitting read and update operations
- Updates are queued into RabbitMQ for eventual consistency
- Data persisted in Cassandra
You will need the following dependencies
- Python 3.6
- Docker, Docker Compose
I recommend using virtualenv or similar to manage your python environment. Either way, you need to eventually pull the python packages you need which you can do by running pip
pip install -r requires.txt
The downstream dependencies (Cassandra and RabbitMQ) are hosted in containers and are defined in the docker-compose.yml file. To start the containers, simply invoke docker compose like this
docker-compose up
To create the message queues, cassandra key space and tables, use the following python scripts
python src/setup/cass.py
python src/setup/rabb.py
To start the REST api service, use connexion
connexion run swagger/recipes.yml -v --debug
You can then view the swagger UI at
localhost:5050/ui
- Update service
- Development environment in docker
- DI
- Unit tests
- Resilience
- Move connection settings into ENV