EventStoreDB vs PostgreSQL

Writing about EventStore and PostgreSQL was such an interesting experience. I thoroughly enjoy using both technologies, but it was also important to convey how when used together that they truly complement each other by providing flexibility and value to both developers and the business.

Mother elephant with twins in Amboseli National Park, Kenya, East Africa.
Photo taken by Diana Robinson. Mother elephant with twins.

I did it. I finally gave in and created a headline that can be called click-bait. Did it work, or did you accidentally get here somehow?

I recently wrote a piece over on the Event Store blog, less aggressively titled, EventStoreDB and PostgreSQL. Here I will write some of the thoughts I had going into the piece now that it has been published.

The Fascination

It was such an interesting, yet challenging, piece to write. I continue to be fascinated by and thoroughly enjoy using both EventStoreDB and PostgreSQL, so I wanted to make sure that was evident to readers. Like with anything I've written, filmed, or coded for the company, I wanted to make sure my honest, genuine, goofy, and sometimes off-kilter voice would be apparently. The role of developer advocate is still new to me, even half a year in. If you're unfamiliar with the role, check out Angie Jones's excellent article about it!

Objectively, it was important that when both these data storage technologies are used in an event sourced system that they truly complement each other, because that has been exactly my experience. When leveraged to use both their strengths, they provide an incredible amount of value and flexibility. Not just to "the business", but to developers as well.

That's actually one thing I really like about seeing a well-crafted event sourced system in production. One that has followed the lessons of seasoned practitioners and not ignored their warnings. Where individuals can first-hand see they aren't incredibly difficult to create, maintain, or test.

The Challange

Okay, so what was the challenge?

The challenge was about what isn't being said. What people have a tendency to ask when bringing up two similar-yet-different technologies, or any two things for that matter:

What Database Is Better?

Given that one database was built from the ground up specializing for a specific method of data storage, while the other has been cooking for nearly four-decades and is known for its extensibility (among other things), comparing the two just doesn't make sense to me.

If one had to be picked, I'm going to continue to ask why? Because of an imaginary constraint in this imaginary scenario? If we're going to that route, we cannot discount that whoever is going to pay the bill at the end of the month (a phrase) is truly the one who is deciding here. Either directly or from the person they've delegated to make such decisions for them as they hold the coin pursue.

We should be using the right tools for the job, yet constraints and preferences certainly are a factor whether we want to admit it or not.

Exclusively PostgreSQL

It would be unfair for me to end this thought exercise without mentioning I have used PostgreSQL exclusively in multiple event sourced systems in the past. Where it was responsible for both the write and read sides. It did a damn fine job!

Were there problems? Sure.

Were the problems avoidable? Largely, I'd say, yes. However, we didn't have any well-versed event sourcing practitioners on staff at the time. Knowing what I know now would have helped. Live and learn.

Do other event sourcing practitioners bring up these problems when they talk about using relational databases as an event store? No. Not as often as I would like to see. However, I did recently watch a talk where the presenter showed an interesting slide that highlights one of these problems and I'd like to expand on in the future. That isn't for this article. Stay tuned?

That's All Folks

That's all I have in the tank for this blog. Again, this was a bit more of a thought-dump from having written an article about these two technologies I have and will continue to use.

Striking A Balance

I'm still trying to find a balance when it comes to where I want to exhaust these thoughts. I'll be (re) launching a YouTube channel soon as another outlet to get some of these ideas out. I've been trying to brush up on my video editing skills from my video game fan site days, but it's been a process! Point being, is that it should allow for a higher level of creativity that I do not personally get out of writing.

Plus, there's a real need for people to show how event sourced applications are made, and what better format is there than seeing someone actually code one?

Erik out. πŸ‘‹