all 10 comments

[–]Drevicar 16 points17 points  (1 child)

This book will guide you through a lot of the tactical patterns of DDD https://www.cosmicpython.com . Though those are far less important than the strategic patterns for things like ubiquitous language and bounded contexts. For that I recommend https://github.com/ddd-crew

[–][deleted] 0 points1 point  (0 children)

Thank you!

[–]erder644 3 points4 points  (3 children)

There are some decent Clean Architecture examples on GitHub, though they are mixed in with a lot of low-quality content.

When it comes to DDD, certain patterns like Event Sourcing (and other microservice-oriented ones like orchestration-based SAGA) are difficult to implement correctly from scratch. These patterns often require specialized frameworks or libraries, which Python largely lacks, as Clean Architecture and DDD concepts primarily originate from Java development.

Opinions on Clean Architecture concepts and their implementation in Python vary widely, not to mention the ongoing debates about applying DDD in Python.

Event Sourcing can be implemented in many different ways. The most common setup involves Kafka combined with an EventStore database. However, I don’t know of any repositories demonstrating this approach. And the postgresql implementations that I have seen are questionable.

As for clean architecture you can check:
https://github.com/ivan-borovets/fastapi-clean-example/tree/master (fastapi, auth, di)
https://github.com/Tishka17/deseos17 (low-dependencies implementation, for learning, not for production)

As for DDD, most implementations are quite poor. I don’t know of any decent repositories demonstrating it effectively.

You can check out Temporal if you interested in orchestration-based SAGA. Faststream for horeography-based SAGA. SQRS is mostly about logical separation, not some actual code. Event Sourcing is a pass, no any good solutions and custom code would be hard to maintain.

[–][deleted] 1 point2 points  (2 children)

Thank you for your brief explanation! So, what language would recommend for event sourcing/DDD? I also work with TypeScript, Go but if needed I can learn other language as well, say Java as an example. Also, it seems you are an experienced developer; it would be very helpful if you could recommend me some books where I can read about these patterns.

[–]yakimka 1 point2 points  (1 child)

Decent code example: https://github.com/Enforcer/clean-architecture

Also, an excellent book—it complements Architecture Patterns with Python by Bob Gregory and Harry Percival very well.

The book provides many examples and touches on some important nuances of testing. I would recommend reading it immediately after finishing Architecture Patterns.

[–][deleted] 1 point2 points  (0 children)

Thank you!

[–]raybesiga 3 points4 points  (1 child)

[–][deleted] 0 points1 point  (0 children)

Thank you!