Basic requirements:

  1. Permanent reliable storage
  2. The order of events is defined
  3. Usually it is not necessary to change/delete, but sometimes it is necessary. 2 examples:
    1. The client has disconnected. We do not want to store his data to reduce the cost of storage and for legal requirements.
    2. We have a SaaS solution and there is a restriction on the storage history in the tariff (to limit the cost of storage) – you need to delete

A separate question is whether we want to change old events in order to migrate them to a new event scheme: one option is to bring (but there is a chance to spoil something), the second is not to bring and forever support all versions of all events in the code (increasing the cost of support).

Globally 4 solutions:

  1. traditional database (for example, PostgreSQL)
  2. Document-oriented database (e.g. MongoDB)
  3. Queue system (e.g. Kafka)
  4. A specialized system (for example https://www.eventstore.com or https://developer.axoniq.io/axon-server/overview )

In general, after thinking about it, I have about the following conclusions:

  1. I have not seen good specialized open source solutions (PostgreSQL level), but using commercial ones as the basis for a product is still bad (it’s not for nothing that many people have not even considered the same Oracle in recent years)
  2. There are additional problems with queues (because they are more limited than databases), but starting from some scale it makes sense
  3. A document-oriented database or a traditional one is not so important, it’s more about the technologies used in the company