Greg Young on using the Event Store as a reading model


Greg Young, the chief architect of the Event Store, recently spoke about the projection library in the Event Store and how it can be used as a play model. In his presentation, Greg explained what the projection library is, as well as its main use cases. He also presented a number of examples of practical use.

The Projection Library is a flow database focusing on temporal queries. A time query is used when you want to correlate events that occur over time, such as finding users on Twitter who said the word “gift” within a minute of the word “birthday.” According to Greg, time-based queries are a common type of queries in business systems, which the Event Store resolves easily. When solving the same type of problems with SQL, they often tend to be complex and grow exponentially with the number of subqueries needed.

Features of the projection library include:

  • Take an event stream and convert it to another form, such as selecting a name from a new customer event stream.
  • Partitioning streams into new groups (for example, splitting or joining streams).
  • Projections across multiple streams to enable polling of large amounts of events (for example, simultaneously polling all bank accounts for specific transaction patterns).
  • Continuous queries. Projections can continue to work and as new data arrives, it also enters the result of the query.
  • Issue new events, such as finding orders above a certain size and creating important order events from those orders to perform additional credit check.

The projection library is specially designed for big data issues, continuous queries, and streaming insights.
Greg specifically notes that the Projection Library does not replace NoSQL databases (eg, a document database), which falls far short of its primary use cases.

Projections are normally written in JavaScript, which is the default language, which means that a web browser can be used to write projections. There is also a built-in feature for debugging projections using the browser.

The main interface is AtomPub. Most platforms have the ability to send HTTP requests and therefore can be used to create Event Store clients and be part of a heterogeneous environment as well.

Event Store is a database built around the concepts of an event source where events are stored, instead of the current state like in most types of databases today. Event Store is an open source product, also available with commercial options. It was released in September 2012 at a launch event in London and version 1.0.1 has just been released.


Comments are closed.