Relational Persistence

The capabilities and strong consistency guarantees provided by relational databases make for the simplest approach to implementing append-only persistence. The fact that many enterprises have already standardized on one or more relational database products means there is little to no cost or learning curve to using them for Event Stores.

Since the MySQL database is a popular open source relational database server that is available on several platforms, we will use it to implement an Event Store. The MySQLAppendOnlyStore implements IAppendOnlyStore, acting as an access layer. It will be used to save Events as binary data into an ES_Events table, and to subsequently load those persisted Events.

Here’s the table definition, ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.