One of the hardest things you can do in IT is replacing a piece of software that has both 1) significant complexity and is 2) currently in use.

So, how can you do this?

We decided to follow a step-by-step approach1: first, we understand the events that are significant, then we add the ability to emit these events to our old software.

Next, we create a service that listens to what our old software is telling us, trying to build up state in a new domain model coded separately.

At the same time, we use an eventing mechanism (Kafka) that is able to store all events that happen and replay them as needed – this way, we can have multiple models filled and different implementations of the same model, leveraging the possibilities of an event sourced state handling model.

  1. I will not discuss if rewriting a significantly complex piece of software makes sense - I did not yet have seen a case in my career where this was possible or desirable, but a lot of times it has been asked for, mostly by developers (!).