The Design of an Event Store

The Design of an Event Store

The topics “event-driven architecture” “event stream processing” and “event sourcing” have enjoyed quite a buzz as of late. While the concepts are not new, it would seem that only now the software engineering community is beginning to appreciate the power and flexibility of building autonomous, loosely coupled systems that intelligently react to events, rather than being told what to do.

Now that our industry has gotten on board the event-driven bandwagon, some of us are starting to look beyond our usual building blocks — Kafka, Pulsar, and NATS Streaming — to address the concerns of long-term persistence and intelligent retrieval of events. We are, of course, talking about an event store.

An Approximate Definition

When contemplating event stores, the first question we should ask ourselves is: what exactly is an event store?

As it stands, a canonical definition of an event store does not exist… yet. Everyone has a different understanding of what an event store ought to do, although most practitioners have come to agree that an easily queryable, long-term persistent store of event records is probably in order, given our ongoing investment into this architectural paradigm.

A “store of event records” hardly sounds convincing on its own. Realistically, something as straightforward as this could easily be accomplished with a database, or even Kafka itself. (And other event streaming platforms, for that matter.) Ostensibly, practitioners wouldn’t have coined a term unless it stood on its own merit. So, we turn our attention to the “queryable” part.

We know that the one thing that makes a database powerful is its ability to be queried. There are lots of ways one might query events. Recall, an event is an immutable record of some (presumably) interesting action that occurred at some point in the past. So, for starters, we might want to query event records by a time range. Next, we might want to filter events by certain attributes or relations. For example, “find events that refer to customers X and Y”.

By observing a stream of discrete, chronologically ordered events, we can accurately reconstruct the state of the entity to which these events apply. At the very least, we should be able to reconstruct its observable state. (Where “observable” implies a characteristic, whose change is fully described by an accompanied event record.) Reconstruction of observable state is the very essence of event sourcing. Wouldn’t it be convenient if an event store was somehow augmented with an ability to enact event sourcing?

Read the rest of the article on Medium.

要查看或添加评论,请登录

Emil Koutanov的更多文章

  • Contrasting Kafka with Akka

    Contrasting Kafka with Akka

    My software architecture consulting gigs take me places ranging from startups to more established organisations, having…

  • Combining strict order with massive parallelism using Kafka

    Combining strict order with massive parallelism using Kafka

    Having been involved in several large-scale Kafka projects for different clients across a broad range of industries, I…

  • Logging on the Cheap

    Logging on the Cheap

    To log or not to log? Writing new code is a relatively small part of application development. A much larger part of a…

    1 条评论
  • Contrasting NATS with Apache Kafka

    Contrasting NATS with Apache Kafka

    TL;DR Kafka is an Event Streaming Platform, while NATS is a closer to a conventional Message Queue. Kafka is optimised…

  • Apache Kafka in a Nutshell

    Apache Kafka in a Nutshell

    So, you’ve heard of this Kafka thing that’s popping up all over the shop. From green-sprout startups to greedy…

    1 条评论
  • Why Kafka Is So Fast

    Why Kafka Is So Fast

    Discover the deliberate design decisions that have made Kafka the performance powerhouse it is today. The last few…

    2 条评论
  • Getting Started With Istio

    Getting Started With Istio

    Understanding what a service mesh is and how it can be used effectively in a microservices architecture. The last few…

  • Kafka Gotchas

    Kafka Gotchas

    I've assisted several large clients in building a microservices-style architecture using Kafka as a messaging backbone,…

  • Introduction to Event Streaming with Kafka and Kafdrop

    Introduction to Event Streaming with Kafka and Kafdrop

    Event sourcing, eventual consistency, microservices, CQRS..

社区洞察

其他会员也浏览了