/cqrs-python-demo

For research purposes only. Learn from our experiments :)

Primary LanguagePythonMIT LicenseMIT

WIP

cqrs-python-demo

For research purposes only. But feel free to learn from our experiments :)

Generally this is an attempt to do the following:

  • working CQRS system
  • event sourced
  • view model
  • commands
  • single REST api (for convenience)

Built with 🍁 by fellows of ferstdigital.com

The Stack

Since we're considering event-sourcing and CQRS for our own techstack, I wanted to try it out first hand, using some pre-made event-source offering. The focus was to get a practical feel of a CQRS implementation, and the possible issues with event-sourcing.

Other event-sourcing considerations

Install

copy docker.env to .env

Easiest way to get this up and running is to use docker-compose.

2. For docker-compose: docker-compose up -d --build

2. Locally

copy docker.env to .env

setup python virtualenv env . env/bin/activate pip install -r requirements.txt

start the view model sync

python apps/readaccount/app.py

start the REST api

gunicorn apps.restaccount.app

Development

docker-compose up -d postgres docker-compose up -d eventstore

see docker-compose.yml for exposed ports, passwords, et al.

What is CQRS?

CQRS stands for Command Query Responsibility Segregation

https://martinfowler.com/bliki/CQRS.html

Learn more about CQRS

If you're new to microservices or command query responsibility segregation checkout some of these resources which I found particularily useful.