Event Store logo

sss https://eventstore.org Menu

Developer Blog

Projections vs RxJS vs etc

  |   Written by: Greg Young   |   Articles

There was a pretty good question this morning when I checked comments on posts. “What is the difference between projections and, say, rxjs?”

We could as easily include any of the functional reactive libraries out there (bacon.js, flapjax, elm, Rx, etc). We can also start going way back and looking at predecessors like CLM.

Let’s start with the similarities both are JavaScript. Both are functional reactive APIs (this is why they look rather similar). They if you go way back trace their lineages to the same places. All have concepts like “streams”, “events”, and “behaviours” as these are underlying concepts. There are however some differences as well.

In particular the tools are handling CEP.

The largest difference is most of those tools listed are only capable of being run from now forward (for some you could write persistent adapters, we had experimented with one for Rx). They are small libraries for dealing with things like events in a JavaScript UI. You could build up everything around something like RxJS as well (e.g. we could switch out our definitions for ones matching theirs).

When we talk about projections, the streams are persistent (and distributed). We host V8 internally and use this API as our query language over persistent streams of events. A projection is not just for running from this point forward but for running against previous history as well. This is a very powerful idea (and not a new one).

Projections are the query language of the Event Store. When you write a projection you can specify that you want it to run for history and stop or you want it to run for the history and continue. The Event Store will also handle you doing this in a durable, consistent, and distributed way (over terabytes of indexed data). A projection will survive a power outage as example if configured to do so.

I hope this helps to clear up some of the similarities and differences between the options.

Subscribe to the Event Store blog

Get the latest news and tutorials when they are released

You might also like

    Guest post: Subscription service for Event Store

      |   Written by: Steven Blair   |   Articles

    VME Retail have released version 1.0.0 of their Subscription Service, which is intended to make life that little bit easier for delivering events from Event Store to clients. The Subscription Service has been used privately by VME Retail Ltd for a few years in various solutions, and they have decided to open the code up to the rest of the Event Store community.

    Read article

    Case Study: How Event Sourcing is Spurring Linedata’s Digital Transformation

      |   Written by: Dave Remy   |   Articles

    Event sourcing is relatively new to the financial services industry. By implementing Event Store’s approach to support its digital transformation strategy, Linedata can be more responsive to the changing needs of its customers and gain a competitive edge in the market. “The core benefits of event-driven architecture allowed us to improve quality, performance and respond quickly to our customers,” said Adrian Tovey, who leads Linedata’s global program management. “Event Store has helped us meet the demand for change in the industry, a change in the way applications are used to deliver services to our customers; Linedata is at the forefront of those changes.”

    Read article

    Disabling disk caching in Ubuntu

      |   Written by: James Nugent   |   Articles

    Amongst the many interesting discussions I had at Build Stuff last week was about how it’s desirable to switch off disk caching for the disks used for Event Store databases to help ensure that data is durable in the face of power failures. This is actually true of many databases, indeed, postgres gives you a warning about the possible dire consequences of having write caching switched on when you may experience power failure. You can...

    Read article