So the problem to solve today is environments as it comes to the event store implementation. Currently, we have 3 different environments, prod, qa, and dev. In true essence of COMPLETELY BLASPHEMY, the previous implementation had a single database that was used for all environments which is just… omg. That’s right, the production database was also the dev database… I … just can’t even… anyway…

In the past, the way that we dealt with this in RDMS land was to created a suite of scripts that would scrub the production data and then replicate it to a gold image which would be periodically deployed to our qa and development servers. It was financial data, so the scrubbing was important. I don’t think this is the case right now. We have a surprisingly small amount of customer data since most are just surveys and reviews. Not really identifying or usable out of context. With that said, I think we could probably just replicate the data.

Our event store implementation isn’t really built for replication, but I found an easier way to approach that should only take me an hour or two to code up. Basically, I’m going to create a windows service that is going to subscribe to all streams in the production EventStore and then publish them to the qa and dev eventstores. Basically, imitating a replication process. This is will be a tiny amount of code so the service will be tiny, and the messaging is all done over TCP as the nuget library has already provided, so it’s fairly fast. This should give us usable data in each environment with which we can develop. Likewise, for those few processes that can only be done in production (e.g. provisioning of resources via SalesForce, and other lame one-offs), this will make the process of using it much easier, I think. Also, since it goes straight to the event store, it will not affect the domain or cause any side effects but 1 — it will cause denormalizers to pick up the data and write it to our read model. That’s actually what we want, so it should be ok.

I’m gonna go write that in a about a half hour, once visual studio 2017 finishes installing 🙂

Leave a Reply