CockroachDB as Eventstore a good idea?

I am looking for an EventStore for the EvenSourcing and CQRS system, which I plan to develop in the near future. I'm getting started with CockroachDB and am impressed with the scalability having all these guarantees that are good for an event store and queries on it.

I think there is, I think, one (?) Table for events. Something similar to this:

Columns in a table

  • AggregateId [Guid]
  • Data [Blob]
  • SequenceNumber [Long]
  • Version [Int]

I have two questions:

  • Is CockroachDB a good choice as an EventStore?
  • Will it match my performance and scale metrics in this scenario. For example, will it scale as expected as data grows over time and more read traffic / write operations?
+3


source to share


1 answer


Cockroachdb is a good choice as an event store. The only thing to look out for is how you choose your primary key. If you are using a timestamp as the primary key, you will see that all the records fall into the same node, so it is better to choose a key such that the records made over time are distributed evenly across all nodes. Choosing a random number as the event ID and using that as the key will work.



CockroachDB does not yet (shortly) support notifications of database changes, which might be useful when used as an event store

+2


source







All Articles