sysid blog

Software Architecture 2022

A refresher in software architecture philosophies with Perseverance, Patience and Python.

This is a high-speed overflight over current approaches with an occasional deep dive.

CRUD, MVC

DDD and Clean Architecture

Every system has these two kind of arrows: the dotted-green one showing the flow of control (or the flow of data in your system) and the red one showing the source code dependency.

Usually, both of them are pointing in the same direction. However, with the dependency inversion principle, we can invert the red arrow (the dependency arrow) every time we want. Everywhere we need it.

Thanks to the power of polymorphism.

DDD, CQRS and Event Sourcing

So let’s rather focus on Event Sourcing:

Why is it cool?

Modelling flexibility is my favorite:

It is a bold promise which I – due to limited experience – cannot comment on.

Challenges:

Overall I found discussion in the Community to be inconsistent. Similar terms different meanings. E.g. “Event” can mean DomainEvent, Notification, Command, …

Next Level: Food Truck Architecture?

Dissolution of the single Domain Model into many parallel worlds.

Take Event Sourcing, can the idea of Aggregates, generalize event pipelines and then arrive at an interesting conclusion:

?! The Domain Model Fallacy !?

Or is it more “Back to the Future”: multiple canonical models.

The Food Truck Architecture cooks interesting thought food.

Value Proposition: Maximize Modelling Flexibility

The evolutionary demands on software are so huge that I think the first and foremost requirement to fulfill is changeability, malleability. Flexibility first!

It is all about events was intriguing enough for me to refine the provided C# example into a Python model for experimentation and insight.

One pipeline rules all:

For every message a bespoke model (projection) is being created and passed to the processor. And every message (command, query, notification) is handled the same.

Conclusion

The main issues I found while playing with the code revolve around consistency and concurrency:

After all, these issues challenge the very foundation of the model: Forgoing global business objects (e.g. aggregate) and assuming a shared nothing world between pipelines.

The presented ideas are still very early stages and it is not recommended to jump ship with serious workloads. However, it provides ideas worth to be explored deeper! And it is definitely a pleasure to read Ralph’s clear and well writen articles.

So, at least now I can say, that I used my Covid quarantine in a rewarding way :-).

Resources

https://netflixtechblog.com/ready-for-changes-with-hexagonal-architecture-b315ec967749 https://medium.com/gdplabs/clean-architecture-a8b5d93d0944 https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html https://danielwhittaker.me/2020/02/20/cqrs-step-step-guide-flow-typical-application/ https://ralfw.de/food-truck-architecture-its-all-about-events/ https://www.eventmodeling.org/posts/what-is-event-modeling/

#python #work