“We can solve any problem by introducing an extra level of indirection” — Event Sourcing is the privileged model to do it.

The idea of Event Sourcing is the following: to capture and save the changes of an application state as events. Before the term has been coined by Martin Fowler, the idea was referred as the Append-Only-Log, Write-Ahead-Log or simply the Log.

Capturing and saving all the application changes has the advantage of allowing to know the state of the application for any given instant and also to know how it got there. Event Sourcing brings two key features…


In Bali a bath in Pura Tirta Empul is a Public Event

I’ve seen many implementations of Event Sourcing that use a message broker to publish events to the read models. I’ve used that pattern and contributed to ES “frameworks” that implement that pattern. I think It is a bad idea. I’ll explain why:

1) Writing to the event store AND publishing events to a broker needs to be atomic. In most cases a distributed transaction using two phase commits is not an option. We need to create some mechanism to deal with faulty connections between publisher and broker:


Part I: Intro

Cuba migrated to a centrally planned economy with the revolution. It didn’t scaled well.

Microservices are an architectural pattern that allows big software systems to be break in smaller parts. Each microservice can be developed, maintained, deployed and operated independently.

Microservices share the same general principles of any modular architecture: break the system into smaller, independent, loosely coupled modules that communicate using a well defined interface (API).


Enjoying some Balinese coffee in Ubud. A memory that triggers wonderful emotion.

As a student I never liked language subjects. Portuguese, English, French. But now I regret not have taken more advantage of it. Specially the French. Portuguese is my main language and English is so global that you would learn it anyway. But French and others escaped.

Although I regret not have learned more languages sooner, I believe the blame is not entirely on me, neither on all the students that struggle with the education system. In fact I believe there is something very wrong about how education currently works.

I believe we all are beings of emotion and expression need…


In the summer of 2005, the president George W. Bush, after reading a book about the 1918 pandemic, created an action plan prepared for a pandemic scenario. The plan included funding for vaccine research, storage of essential supplies and a playbook and simulation exercises. It seems that he realised the importance of speed of action in a pandemic scenario:

“A pandemic is a lot like a forest fire,” Bush said at the time. “If caught early it might be extinguished with limited damage. …


The year of 2019 ended, it’s time to get a retrospective about the year readings. I read less than I would like but nevertheless it was a year of wonderful discoveries. Any type of review is tricky. Unless you are an expert on the subject matter, any review says much more about the author of the review than about the subject. What I’m writing here are just a couple of paragraphs about what the books did for me, not trying to put myself on the shoes of any book critics.

You can check my Goodreads profile here.

1984 — George Orwell

The communism experience…


  • You can read the part 1 here.
  • You can read the part 2 here.

In the last parts it was presented an evolutionary path towards an event driven architecture to support multiple read models. We ended with an architecture with a relational database that supports write operations where the business invariants are ensured, an event queue, a broker to dispatch messages, and an Integrator to update changes to read-only databases (Image 1). In this part 3 It will be presented an Event Sourcing alternative and be discussed some nuances in the adoption of such solution.

Image 1 — Final Architecture…


You can read the part 1 here.

Designing a Booking Service

In part 2 we will start to design a booking service, iterate over it and discuss all the steps. Let’s start with some requirements. We need a back-office to create hotels. Each hotel has a list of rooms. Each room has a capacity, a price and a reservation list with the interval of dates when it is booked. A hotel has an address, a city, a country and a list of facilities like pool, gym, children parks, etc. A back-office user can created and edit the hotel data, create new rooms, and manage…


Software industry is a never-ending growing beast where new technologies are cusped every day. The disruption is so frenetic that even a Savant cannot keep with it. Using only a relational database is not enough. We need to use document databases, graphs, lucene, key value stores, in-memory databases, and maybe others. As you should know, using just one model for your application is not enough.

Using ActiveMQ or RabbitMQ is for suckers. The vanguardista uses Kafka and implements event sourcing (beside Kafka not supporting it). You need containers and serverless over Kubernetes if your shit is real. Don’t forget to…

Diogo Machado

Software developer @Sky. Developing software on the shoulders of giants.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store