black-background-10x10.png
 
 
 

Current Version: 0.2.0.2
Status: Stable / Production

 
 

Microservices, Autonomous Services, Service-Oriented Architecture, and Event Sourcing Toolkit for Ruby
with Support for Event Store and Postgres

 

Install

Event Store

gem install eventide-event_store

Or add the following to your Gemfile:

gem eventide-event_store
 

Postgres

gem install eventide-postgres

Or add the following to your Gemfile:

gem eventide-postgres

Introduction

Handlers

A handler is the entry point to a service. It receives instructions from other services, apps, and clients. You might think of them as controllers in MVC terms, but that's a very loose comparison.

View example »

Commands

Commands tell services what to do. Commands are messages. They are the primary inputs to a service. They're just data structures.

View example »

Events

Events are how services tell each other what they've done. They're also how entities within a service store and retrieve their state. An event is also a message, and also just a data structure. You might think of events as responses to commands.

View example »

Entities

Entities are a service's model objects. Handlers make use of entities to decide how or whether to process a message. You might think of entities as model objects, but there's no ORM here, and these are not ORM models. Entities are just data structures. They may have business logic operations that affect an entity's attributes.

View example »

Stores

Stores are the data retrieval and caching for a service's entities. Entities are retrieved from stores. The store keeps track of how current an entity is based on its version number. It uses that version number to retrieve only recent events to apply to the entity.

View example »

Projections

Projections turn a stream of events into an entity's data. When the store retrieves the entity, it runs the projection. But since the entity is event sourced, there's no fixed entity row to retrieve. Instead, the events that pertain to an entity are retrieved, and then processed in order, in order to construct a view of that entity based on the things that have happened to it.

View example »

Features

Message Store

  • Underlying storage implementation with stream semantics, including categories and expected version protection for writes
  • Primitive raw data format and serialization to JSON
  • Used for both event storage as well as command transport and storage
  • Event source for projected entities
  • Postgres and Event Store support

Messaging

  • Messaging primitives layered on top of the message store
  • Handlers, Messages, Reader, Writer, Streams
  • Handle either message types or raw data
  • Conversion from raw data format to message classes
  • Substitues and telemetry for testing and exercising

 

Entity Projection

  • Apply events recorded to an entity's stream to the entity to restore its data
  • Apply either messages or raw data
  • Use either with a reader or with arbitrary data in-memory
  • Use any entity data structure to project into
  • No special entity base class needed (even an ORM object or a Hash will work)

Entity Store

  • Retrieve an entity from its stream storage
  • Uses entity projection to apply events to the entity
  • Caches retrieved entity using entity cache
  • Retrieves only new events on subsequent reads
  • Substitute dependency to support tests and exercising
  • Configurable batch size of events read

ENtity Cache

  • In-memory (L1) and on-disk (L2) cache of entities
  • Pluggable implementations of both memory and disk cache
  • Used by entity store to avoid re-reading streams in their entirety when retrieving entities
  • Optionally stores entity snapshot to disk
  • Retrieves latest on-disk snapshot before retrieving new events
  • Configurable snapshotting interval

Entity Snapshot

  • Periodic storage of cached entities to disk
  • Pluggable into entity cache
  • Simple interface allows implementation for any storage medium
  • Postgres and Event Store implementations provided, with JSON serialization
  • No special entity base class needed
  • Serialization format is not prescribed
  • Pluggable serialization interface

Consumer

  • Subscription to a stream via a continuous reader
  • Registry of handlers that will be dispatched the stream's commands and events
  • Graceful shutdown of consumers, allowing unit of work to complete
  • Top-level error handling
  • Can be started independently, or coordinated through the component host

Component HOst

  • Hosts components as runtime services
  • Entry point from operating system via start-up script
  • Starts components' consumers
  • Actor model coordinates components and readers
  • Specialized reader pre-fetches batches of events via actor to eliminate waiting on reads

Other Features

  • Data Aggregation tools
  • Dependency declaration and substitution
  • Serialization and transformation protocols
  • Validation protocols
  • Proper casing for JSON vs Ruby naming conventions
  • Data structure mapping and copying utilities
  • And many more....

Community

 

Slack

Sign up for the Eventide Slack team at:
eventide-project-slack.herokuapp.com

Twitter

Follow the Eventide Project on twitter:
twitter.com/eventideproject

 

Ruby Microservices Meetup

Monthly meetups in Austin, and weekly meetups online:
www.meetup.com/ruby-microservices

Email

Get in touch directly via email at:
contact@eventide-project.org

Code

 

GitHub

Eventide Project code is hosted on GitHub:
github.com/eventide-project

A complete list of the libraries that make up the Eventide stack, as well as third=party libraries used, is available on the Libraries page.

 

Examples

 

GitHub

Eventide example code is hosted on GitHub in the Eventide Examples org:
github.com/eventide-examples

 

Account Example

github.com/eventide-examples/account-component

The account component project demonstrates:

  • Command and event handlers
  • Command idempotence
  • Specialized transaction idempotence using the reservation pattern
  • Expected version concurrency protection
  • Event Sourcing
  • Projections
  • Stores
  • Entity streams
  • Category streams
  • Command streams
  • Replying to external services
  • Client library for interaction with other services
  • Consumers
  • Component hosting
  • Connection configuration
  • Dependency substitution
  • Testing
  • Bundler-less runtime

Funds Transfer

github.com/eventide-examples/funds-transfer-component

The funds transfer component demonstrates:

  • Everything covered by the account component
  • Coordination and workflows between multiple services
  • Use of another service's client library
  • Responding to replies from an external service

Account Statement Data Aggregation

(coming soon)

The account statement component demonstrates:

  • Producing materialized views from services' events
  • Specialized idempotence patterns for data aggregation
  • Data command streams

 

 

Docs

 

Documentation has taken a back seat to example code, training materials, and face-to-face engagement. It is presently a top priority, and will be published progressively as it is written. In the mean time, please reach out and we'll address your questions personally.

 

Training

Attend a public workshop or bring specialized training in-house for your team

 

2-Day Intro Workshop

  • Distributed Systems Fundamentals
  • Design Principles
  • Analysis and design for eveted and message based systems
  • Services & Components
  • Service Boundaries
  • Events
  • Commands
  • Handlers
  • Projections
  • Entities
  • Idempotence & Concurrency
  • Testing
  • Message Validation
  • Consumers & Subscriptions
  • Logging
  • Snapshotting State
  • Telemetry

2-Day Advanced Workshop

  • Coordinating Multiple Services
  • Workflows Between Services
  • Building and Distributing Client Libraries for Your Services
  • Packaging and Distribution
  • Hosting and Operations
  • Data Aggregation
  • Error Handling
  • Integration with External APIs
 
 

Custom Training

Get in touch and tell us about the learning that you'd like to do. We can build custom materials and curriculum for you and your team that aligns with you goals and the circumstances of your project.

 

Upcoming Events

 

Montreal.rb
Tuesday, November 21st
www.montrealrb.com

 

About

Eventide was developed in the course of building applications at a consumer financial services company that was versed in service architectures, messaging, and traditional message bus, and had become mired in a legacy of monolith Rails applications.

Eventide is currently the operational, production microservice backbone for a range of financial technology implementations, covering scenarios including:

 
  • Consumer Mobile Banking
  • Payroll
  • P2P Payments
  • Loan Origination
  • Loan Servicing
  • Affiliate Programs
  • Bill Pay
  • Investment
  • Wealth Management
  • Mortgage

The toolkit was operational in production systems for a year before it was open-sourced at the end of 2015.

Eventide will reach a v1 release once documentation and materials are considered sufficient for a new adopter to get their feet wet in event-sourced autonomous services without direct support from the Eventide team.