Business benefits
Performance
Scalable
Flexible
Form
Significance
Relativity
Time
Cause
Aggregation
Event-pattern detection
Event abstraction
Event filtering
Event aggregation and transformation
Modeling event hierarchies
Detecting relationships between events
Abstracting event-driven processes
Financial services
Fraud detection
Business activity monitoring
Security monitoring
The BSD 3-Clause License
(commercial support available)
Windows
Linux
Mac OS X
Replication
Clustering
Master node - responsible for write coordination
Slave nodes - replicas
Two modes:
Manager and database nodes (Commercial)
Database nodes (Open Source / Commercial)
Nodes discovery:
DNS
List of other nodes' addresses
Web based UI
Consists of event data and some system data
eventId - event identifier (could be generated by db)
eventType - defines type of event
data - custom event data
metadata - event metadata
{
"eventId": "8cfedd64-7e40-47ee-a16c-e57e2987783b",
"eventType": "TemperatureMeasured",
"data": {
"zone": "Ireland",
"server": "web1",
"temperature": 64
}
}
Additional custom or system data
$correlationId - application level correlation id
$causationId - application level causation id
(both propagated to any new events produced internally)
Used to store events
The partition point of the system
Streams could be categorized
Category is resolved from stream name (after character "-")
[stream name]-[category]
examples:
temperatures_by_zone-Ireland
temperatures_by_server-web1
$maxAge - maximum age of events in a stream
$maxCount - maximum number of events in a stream
$cacheControl - controls the cache of the head of a stream
$acl - access control list
Permission | Description |
---|---|
$w | write to this stream |
$r | read from this stream |
$d | delete this stream |
$mw | write the metadata of this stream |
$mr | read the metadata of this stream |
{ "$acl" : { "$w" : "john", "$r" : ["john", "thomas"], "$d" : "$admins", "$mw" : "$admins", "$mr" : "$admins" } }
HTTP
TCP
Event streams are exposed as AtomPub feeds
(Atom 1.0. specification)
Restful API
Asynchronous TCP protocol
(Google Protocol Buffers)
clients for C#, Java, Scala, Erlang, Haskell, ...
Scalable for large number of subscribers
(streams are cacheable)
Supported in nearly any environment
If you need really high performance
(many times faster than HTTP)
Append to a stream
Read a stream
Delete stream
Stream subscriptions
Single event write
Batch write
Transactions (TCP API)
Depends on API
HTTP - AtomPub feed, paging, conditional get
TCP - StreamEventSlice/AllEventsSlice
Soft delete - stream could be recreated later
Hard delete - stream couldn't be recreated later
All writes are idempotent
Idempotency is based on the EventId and stream
Also depends on ExpectedVersion
Optimistic locking
ExpectedVersion - normally a number representing the version of the stream
Clients can subscribe to the stream and be notified when new events are written to that stream
Volatile subscriptions
Catch-Up subscriptions
Persistent subscriptions
transform(f3(f2(f1(initial(), e1), e2), e3)
f(state, event) => state
f is run over the series of events
transform(state) => result
transform can transform the state to the form of result
you want to receive
initial() => state
initial returns the initial state
fromAll()
fromStream(stream)
fromStreams(stream1, stream2, ..., streamn)
fromCategory(category)
when([ [SomePatternMatch]: function(state, event) { return new state; }, [OtherPatternMatch]: function(state, event) { return new state; } ... ]);
when([ $init: function(state, event) { return initial state; }, $any: function(state, event) { return new state; } ]);
linkTo(newStream, event)
emit(stream, eventType, eventData)