SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Concursus
Event Sourcing Evolved
GOTO  London  2016
Introductions
Dominic Fox
Twitter: @dynamic_proxy
Email: dominic.fox@opencredo.com
Tareq Abedrabbo
Twitter: @tareq_abedrabbo
Email: tareq.abedrabbo@opencredo.com
Concursus
Page: https://opencredo.com/publications/concursus/
Github: http://github.com/opencredo/concursus
Agenda
• History
• Concepts
• Example
• Domain model
• Processing model
• Programming model
• Future directions
What is Concursus?
A toolkit for processing and organising messy data in an distributed context.
The Concursus Timeline
Observations
Conception and design
Prototype
Open source implementation
Technical report and blogs
Event Sourcing
“Event Sourcing ensures that all changes to application state are stored as a sequence of
events. Not just can we query these events, we can also use the event log to reconstruct
past states, and as a foundation to automatically adjust the state to cope with retroactive
changes.”
http://martinfowler.com/eaaDev/EventSourcing.html
What is Concursus?
Problems Concursus addresses:
ü Processing events in a scalable and reliable way
ü Processing guarantees and ordering: exactly once, out of order, repeated or missed
delivery, etc..
ü Building meaningful domain models to reason about and build business logic around
ü Flexibility: building additional views as needed
Tendencies:
• From internet of users to internet of things
• From “presence” to “presents”
• From monoliths to microservices
Why Concursus?
From Internet of Users to Internet of Things
From Presence to Presents
From Monoliths to Microservices
“Write First, Reason Later”
2016-­‐10-­‐12  
09:06:31.432
Received  at  Depot
2016-­‐10-­‐12  
09:06:32.106
Received  at  Depot
2016-­‐10-­‐12  
09:06:34.740
Received  at  Depot
2016-­‐10-­‐12  
11:35:02.163
Loaded  onto  Truck
2016-­‐10-­‐12  
11:40:21.032
Loaded  onto  Truck
2016-­‐10-­‐12  
11:38:51.204
Loaded  onto  Truck
2016-­‐10-­‐12  
14:12:44.021
Delivery  Failed
2016-­‐10-­‐12  
15:00:31.322
Delivered
2016-­‐10-­‐12  
15:11:05.038
Delivered
“Write First, Reason Later”
Handling Events
ü Delivery constraints
out of order, repeated, delayed or missed delivery
ü Processing guarantees
at least once or exactly once processing, idempotency
ü Ordering
partial ordering across aggregates (with reasonable assumptions)
Data Processing Layers
ü Durable
sufficiently durable buffer for async processing (what’s happening)
ü Persistent
a permanent record of everything that has happened (what happened)
ü Transient
fast and consistent, but also disposable state (what happens)
Building Blocks
• Java 8 and Kotlin: APIs
• Cassandra: Persistent state (Event store)
• Kafka: Durable state (Message broker)
• Hazelcast: Transient state (cache, idempotency filters)
• Also, RabbitMQ and Redis
Sources of Inspiration
Stream processing frameworks such as Apache Storm and Spark
Google papers: Cloud dataflow, MillWheel
Apache Spark papers
The Axon CQRS framework
Domain Driven Design
Functional programming
Summary
Concursus
=
Event sourcing
+
Stream processing
+
Bounded contexts (DDD)
+
Distributed computing
Received  at
Depot
Loaded  onto  
Truck
Delivered
Delivery  Failed
Domain Model: Events
Received  
at
Depot
Loaded  
onto
Truck
Delivery
Failed
Received  
at
Depot
Loaded  
onto
Truck
Delivered
aggregateType: parcel
aggregateId: 69016fb5-1d69-4a34-
910b-f8ff5c702ad9
eventTimestamp: 2016-03-31 10:31:17.981
parameters: { “depotId”: “Lewisham” }
Domain Model: Events
Received  
at
Depot
Loaded  
onto
Truck
Delivery
Failed
Received  
at
Depot
Loaded  
onto
Truck
Delivered
aggregateType: parcel
aggregateId: 69016fb5-1d69-4a34-
910b-f8ff5c702ad9
eventTimestamp: 2016-03-38 08:15:23.104
parameters: { “truckId”: “J98 257” }
Domain Model: Events
Received  
at
Depot
Loaded  
onto
Truck
Delivery
Failed
Received  
at
Depot
Loaded  
onto
Truck
Delivered
eventTimestamp: 2016-03-31T10:36:42.171Z
processingTimestamp: 2016-03-31T10:36:48.3904Z
parameters: { “deliveryAddress”: “123 Sudbury
Avenue, Droitwich DR4 8PQ”}
Domain Model: Events
aggregateType: parcel
aggregateId: 69016fb5-1d69-4a34-
910b-f8ff5c702ad9
Received  at  Depot
Loaded  onto  Truck
Delivery  Failed
Received  at  Depot
Loaded  onto  Truck
Delivered
Domain Model: Summary
Every Event occurs to an Aggregate, identified by its type and id.
Every Event has an eventTimestamp, generated by the source of
the event.
An Event History is a log of Events, ordered by eventTimestamp,
with an additional processingTimestamp which records when the
Event was captured.
Network
Event sources Event processors
Events arrive:
• Partitioned
• Interleaved
• Out-of-order
Processing Model: Ordering
Log is:
• Partitioned by aggregate id
• Ordered by event timestamp
Processing Model: Ordering
CREATE  TABLE  IF  NOT  EXISTS  concursus.Event (
aggregateType text,
aggregateId text,
eventTimestamp timestamp,
streamId text,
processingId timeuuid,
name  text,
version  text,
parameters  map<text,  text>,
characteristics  int,
PRIMARY  KEY((aggregateType,  aggregateId),  eventTimestamp,  
streamId)
)  WITH  CLUSTERING  ORDER  BY  (eventTimestamp DESC);
Cassandra Schema
Cassandra
Event Store
RabbitMQ Topic
Downstream
processingLog
events
Publish
events
Cassandra & AMQP
Cassandra
Event Store
RabbitMQ Topic
Downstream
processing
out-of-order events
ordered query results
Cassandra & AMQP
Cassandra
Event Store
Kafka Topic
Downstream
processing
Event store
listener
Publish
events
Log
events
Cassandra & Kafka
Processing Model: Summary
Events arrive partitioned, interleaved and out-of-order.
Events are sorted into event histories by aggregate type and id.
Events are sorted within event histories by event timestamp, not
processing timestamp.
Event consumers need to take into account the possibility that an
event history may be incomplete at the time it is read – consider
using a watermark to give incoming events time to “settle”.
Programming Model: Core Metaphor
Received  
at
Depot
Loaded  
onto
Truck
Delivery
Failed
Received  
at
Depot
Loaded  
onto
Truck
Delivered
Received  
at
Depot
Loaded  
onto
Truck
Delivery
Failed
Received  
at
Depot
Loaded  
onto
Truck
Delivered
Consumer<Event>
Programming Model: Core Metaphor
You give me a Consumer<Event>, and I send Events to it one at a time:
Emitting Events
I implement Consumer<Event>, and handle Events that are sent to me.
Handling Events
Java 8 Mapping
Java 8 Mapping
Java 8 Mapping
Kotlin Mapping
sealed  class  ParcelEvent {
class  ReceivedAtDepot(val depotId:  String):  ParcelEvent()
class  LoadedOntoTruck(val truckId:  String):  ParcelEvent()
class  Delivered(val destinationId:  String):  ParcelEvent()
class  DeliveryFailed():  ParcelEvent()
}
Kotlin Mapping
eventBus.dispatchTo(parcelId,
ReceivedAtDepot(depotId =  "Lewisham Depot")  at  start,
LoadedOntoLorry(lorryId =  "Truck  CU50  ZCV")  at  
start.plus(2,  DAYS)
)
Kotlin Mapping
fun  describeEvent(event:  ParcelEvent):  Unit  =  when  (event)  {
is  ReceivedAtDepot -­‐>  println("Received  at  depot:  
${event.depotId}")
is  LoadedOntoTruck -­‐>  println("Loaded  onto  truck:  
${event.truckId}")
is  Delivered  -­‐>  println("Delivered  to:  
${event.destinationId}")
is  DeliveryFailed -­‐>  println("Delivery  failed")
}
Event-handling middleware is a chain of Consumer<Event>s that transforms, routes, persists
and dispatches events. A single event submitted to this chain may be:
■ Checked against an idempotency filter (e.g. a Hazelcast distributed cache)
■ Serialised to JSON
■ Written to a message queue topic
■ Retrieved from the topic and deserialised
■ Persisted to an event store (e.g. Cassandra)
■ Published to an event handler which maintains a query-optimised view of part of the system
■ Published to an event handler which maintains an index of aggregates by event property
values (e.g. lightbulbs by wattage)
Event-Handling Middleware
• Kafka Streams
• Narrative threads across event histories
• Generic Attribute indexing
• State management and caching
• Improved cloud tooling
Future Directions
Thank you for listening
Any questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (10)

Microservices - Scaling Development and Service
Microservices - Scaling Development and ServiceMicroservices - Scaling Development and Service
Microservices - Scaling Development and Service
 
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
LJC: "Chuck Norris Doesn't Do DevOps...but Java developers might benefit"
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfalls
 
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal GancarzServerlessConf: Serverless for the Enterprise - Rafal Gancarz
ServerlessConf: Serverless for the Enterprise - Rafal Gancarz
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
DockerCon EU 2018 "Continuous Delivery with Docker and Java"DockerCon EU 2018 "Continuous Delivery with Docker and Java"
DockerCon EU 2018 "Continuous Delivery with Docker and Java"
 
JAX DevOps 2018 "Continuous Delivery Patterns for Modern Architectures"
JAX DevOps 2018 "Continuous Delivery Patterns for Modern Architectures"JAX DevOps 2018 "Continuous Delivery Patterns for Modern Architectures"
JAX DevOps 2018 "Continuous Delivery Patterns for Modern Architectures"
 
Cloud anti-patterns
Cloud anti-patternsCloud anti-patterns
Cloud anti-patterns
 
O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...
O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...
O'Reilly SACON NY 2018 "Continuous Delivery Patterns for Contemporary Archite...
 
Lisbon DevOps: "Seven (More) Deadly Sins of Microservices"
Lisbon DevOps: "Seven (More) Deadly Sins of Microservices"Lisbon DevOps: "Seven (More) Deadly Sins of Microservices"
Lisbon DevOps: "Seven (More) Deadly Sins of Microservices"
 

Andere mochten auch

Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
OpenCredo
 

Andere mochten auch (19)

Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
Haufe #msaday - Seven More Deadly Sins of Microservices by Daniel Bryant
 
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
Voxxed Bristol 2017 - From C to Q, one event at a time: Event Sourcing illust...
 
Evolving Project Management: from the sin to the virtue by Antonio Cobo
Evolving Project Management: from the sin to the virtue by Antonio CoboEvolving Project Management: from the sin to the virtue by Antonio Cobo
Evolving Project Management: from the sin to the virtue by Antonio Cobo
 
Reactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo NicoraReactive Microservices By Lorenzo Nicora
Reactive Microservices By Lorenzo Nicora
 
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
O'Reilly 2016: "Continuous Delivery with Containers: The Trials and Tribulati...
 
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
Haufe #msaday - Building a Microservice Ecosystem by Daniel Bryant
 
High Load Strategy 2016 - Project Management: from Stone Age to DevOps
High Load Strategy 2016 - Project Management: from Stone Age to DevOps High Load Strategy 2016 - Project Management: from Stone Age to DevOps
High Load Strategy 2016 - Project Management: from Stone Age to DevOps
 
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
A Visual Introduction to Event Sourcing and CQRS by Lorenzo NicoraA Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
A Visual Introduction to Event Sourcing and CQRS by Lorenzo Nicora
 
muCon 2016: Authentication in Microservice Systems By David Borsos
muCon 2016: Authentication in Microservice Systems By David BorsosmuCon 2016: Authentication in Microservice Systems By David Borsos
muCon 2016: Authentication in Microservice Systems By David Borsos
 
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal GancarzQCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
QCON London 2017 - Monitoring Serverless Architectures by Rafal Gancarz
 
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt LongLondon Hashicorp Meetup #8 -  Testing Programmable Infrastructure By Matt Long
London Hashicorp Meetup #8 - Testing Programmable Infrastructure By Matt Long
 
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
Haufe #msaday - The Actor model: an alternative approach to concurrency By Lo...
 
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
Microservices Manchester: Microservices and Macro-Economics - A Shorty Histor...
 
Vault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructureVault: Beyond secret storage - Using Vault to harden your infrastructure
Vault: Beyond secret storage - Using Vault to harden your infrastructure
 
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
Microservices Manchester:  Security, Microservces and Vault by Nicki WattMicroservices Manchester:  Security, Microservces and Vault by Nicki Watt
Microservices Manchester: Security, Microservces and Vault by Nicki Watt
 
Microservices Manchester: Authentication in Microservice Systems by David Borsos
Microservices Manchester: Authentication in Microservice Systems by David BorsosMicroservices Manchester: Authentication in Microservice Systems by David Borsos
Microservices Manchester: Authentication in Microservice Systems by David Borsos
 
Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster Spring Boot Microservices vs Akka Actor Cluster
Spring Boot Microservices vs Akka Actor Cluster
 
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
ThingMonk 2016 - Concursus Event sourcing for the IOT By Tareq Abedrabbo & Do...
 
Chronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for PrometheusChronix as Long-Term Storage for Prometheus
Chronix as Long-Term Storage for Prometheus
 

Ähnlich wie GOTO LONDON 2016: Concursus Event sourcing Evolved (Updated)

Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...
JAXLondon2014
 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
confluent
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Guido Schmutz
 
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
François Garillot
 

Ähnlich wie GOTO LONDON 2016: Concursus Event sourcing Evolved (Updated) (20)

Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...Building Microservices with Scala, functional domain models and Spring Boot -...
Building Microservices with Scala, functional domain models and Spring Boot -...
 
#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...#JaxLondon: Building microservices with Scala, functional domain models and S...
#JaxLondon: Building microservices with Scala, functional domain models and S...
 
Event Sourcing - what could go wrong - Jfokus 2022
Event Sourcing - what could go wrong - Jfokus 2022Event Sourcing - what could go wrong - Jfokus 2022
Event Sourcing - what could go wrong - Jfokus 2022
 
Stateful Microservices with Apache Kafka and Spring Cloud Stream with Jan Svo...
Stateful Microservices with Apache Kafka and Spring Cloud Stream with Jan Svo...Stateful Microservices with Apache Kafka and Spring Cloud Stream with Jan Svo...
Stateful Microservices with Apache Kafka and Spring Cloud Stream with Jan Svo...
 
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
FlinkForward Asia 2019 - Evolving Keystone to an Open Collaborative Real Time...
 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
 
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...Dev fest 2020 taiwan   how to debug microservices on kubernetes as a pros (ht...
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
 
OpenWhisk: Where Did My Servers Go?
OpenWhisk: Where Did My Servers Go?OpenWhisk: Where Did My Servers Go?
OpenWhisk: Where Did My Servers Go?
 
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
Spark (Structured) Streaming vs. Kafka Streams - two stream processing platfo...
 
Event sourcing - what could possibly go wrong ? Devoxx PL 2021
Event sourcing  - what could possibly go wrong ? Devoxx PL 2021Event sourcing  - what could possibly go wrong ? Devoxx PL 2021
Event sourcing - what could possibly go wrong ? Devoxx PL 2021
 
BBL KAPPA Lesfurets.com
BBL KAPPA Lesfurets.comBBL KAPPA Lesfurets.com
BBL KAPPA Lesfurets.com
 
Fabric - Realtime stream processing framework
Fabric - Realtime stream processing frameworkFabric - Realtime stream processing framework
Fabric - Realtime stream processing framework
 
Sparkling Water Webinar October 29th, 2014
Sparkling Water Webinar October 29th, 2014Sparkling Water Webinar October 29th, 2014
Sparkling Water Webinar October 29th, 2014
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Implementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDBImplementing and Visualizing Clickstream data with MongoDB
Implementing and Visualizing Clickstream data with MongoDB
 
Auto Scaling for Multi-Tier Containers Topology
Auto Scaling for Multi-Tier Containers TopologyAuto Scaling for Multi-Tier Containers Topology
Auto Scaling for Multi-Tier Containers Topology
 
Data Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメントData Microservices In The Cloud + 日本語コメント
Data Microservices In The Cloud + 日本語コメント
 
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
 

Mehr von OpenCredo

Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
OpenCredo
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
OpenCredo
 

Mehr von OpenCredo (12)

Webinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform EngineeringWebinar - Design Thinking for Platform Engineering
Webinar - Design Thinking for Platform Engineering
 
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
MuCon 2019: Exploring Your Microservices Architecture Through Network Science...
 
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
Goto Chicago; Journeys To Cloud Native Architecture: Sun, Sea And Emergencies...
 
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
Mucon 2018: Heuristics for Identifying Microservice Boundaries By Erich Eichi...
 
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki WattJourneys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
Journeys To Cloud Native Architecture: Sun, Sea And Emergencies - Nicki Watt
 
Machine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens LourensMachine Learning Game Changer for IT - Maartens Lourens
Machine Learning Game Changer for IT - Maartens Lourens
 
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto FernandezKafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
Kafka Summit 2018: A Journey Building Kafka Connectors - Pegerto Fernandez
 
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq AbedrabboMuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
MuCon 2017: A not So(A) Trivial Question by Tareq Abedrabbo
 
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps  By Antoni...
DevOpsCon Berlin 2017: Project Management from Stone Age to DevOps By Antoni...
 
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
Hashidays London 2017 - Evolving your Infrastructure with Terraform By Nicki ...
 
Succeeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal GancarzSucceeding with DevOps Transformation - Rafal Gancarz
Succeeding with DevOps Transformation - Rafal Gancarz
 
Progscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal GancarzProgscon 2017: Serverless Architectures - Rafal Gancarz
Progscon 2017: Serverless Architectures - Rafal Gancarz
 

Kürzlich hochgeladen

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 

GOTO LONDON 2016: Concursus Event sourcing Evolved (Updated)

  • 2. Introductions Dominic Fox Twitter: @dynamic_proxy Email: dominic.fox@opencredo.com Tareq Abedrabbo Twitter: @tareq_abedrabbo Email: tareq.abedrabbo@opencredo.com Concursus Page: https://opencredo.com/publications/concursus/ Github: http://github.com/opencredo/concursus
  • 3. Agenda • History • Concepts • Example • Domain model • Processing model • Programming model • Future directions
  • 4. What is Concursus? A toolkit for processing and organising messy data in an distributed context.
  • 5. The Concursus Timeline Observations Conception and design Prototype Open source implementation Technical report and blogs
  • 6. Event Sourcing “Event Sourcing ensures that all changes to application state are stored as a sequence of events. Not just can we query these events, we can also use the event log to reconstruct past states, and as a foundation to automatically adjust the state to cope with retroactive changes.” http://martinfowler.com/eaaDev/EventSourcing.html
  • 7. What is Concursus? Problems Concursus addresses: ü Processing events in a scalable and reliable way ü Processing guarantees and ordering: exactly once, out of order, repeated or missed delivery, etc.. ü Building meaningful domain models to reason about and build business logic around ü Flexibility: building additional views as needed
  • 8. Tendencies: • From internet of users to internet of things • From “presence” to “presents” • From monoliths to microservices Why Concursus?
  • 9. From Internet of Users to Internet of Things
  • 10. From Presence to Presents
  • 11. From Monoliths to Microservices
  • 12. “Write First, Reason Later” 2016-­‐10-­‐12   09:06:31.432 Received  at  Depot 2016-­‐10-­‐12   09:06:32.106 Received  at  Depot 2016-­‐10-­‐12   09:06:34.740 Received  at  Depot 2016-­‐10-­‐12   11:35:02.163 Loaded  onto  Truck 2016-­‐10-­‐12   11:40:21.032 Loaded  onto  Truck 2016-­‐10-­‐12   11:38:51.204 Loaded  onto  Truck 2016-­‐10-­‐12   14:12:44.021 Delivery  Failed 2016-­‐10-­‐12   15:00:31.322 Delivered 2016-­‐10-­‐12   15:11:05.038 Delivered
  • 14. Handling Events ü Delivery constraints out of order, repeated, delayed or missed delivery ü Processing guarantees at least once or exactly once processing, idempotency ü Ordering partial ordering across aggregates (with reasonable assumptions)
  • 15. Data Processing Layers ü Durable sufficiently durable buffer for async processing (what’s happening) ü Persistent a permanent record of everything that has happened (what happened) ü Transient fast and consistent, but also disposable state (what happens)
  • 16. Building Blocks • Java 8 and Kotlin: APIs • Cassandra: Persistent state (Event store) • Kafka: Durable state (Message broker) • Hazelcast: Transient state (cache, idempotency filters) • Also, RabbitMQ and Redis
  • 17. Sources of Inspiration Stream processing frameworks such as Apache Storm and Spark Google papers: Cloud dataflow, MillWheel Apache Spark papers The Axon CQRS framework Domain Driven Design Functional programming
  • 19. Received  at Depot Loaded  onto   Truck Delivered Delivery  Failed
  • 20. Domain Model: Events Received   at Depot Loaded   onto Truck Delivery Failed Received   at Depot Loaded   onto Truck Delivered
  • 21. aggregateType: parcel aggregateId: 69016fb5-1d69-4a34- 910b-f8ff5c702ad9 eventTimestamp: 2016-03-31 10:31:17.981 parameters: { “depotId”: “Lewisham” } Domain Model: Events Received   at Depot Loaded   onto Truck Delivery Failed Received   at Depot Loaded   onto Truck Delivered
  • 22. aggregateType: parcel aggregateId: 69016fb5-1d69-4a34- 910b-f8ff5c702ad9 eventTimestamp: 2016-03-38 08:15:23.104 parameters: { “truckId”: “J98 257” } Domain Model: Events Received   at Depot Loaded   onto Truck Delivery Failed Received   at Depot Loaded   onto Truck Delivered
  • 23. eventTimestamp: 2016-03-31T10:36:42.171Z processingTimestamp: 2016-03-31T10:36:48.3904Z parameters: { “deliveryAddress”: “123 Sudbury Avenue, Droitwich DR4 8PQ”} Domain Model: Events aggregateType: parcel aggregateId: 69016fb5-1d69-4a34- 910b-f8ff5c702ad9 Received  at  Depot Loaded  onto  Truck Delivery  Failed Received  at  Depot Loaded  onto  Truck Delivered
  • 24. Domain Model: Summary Every Event occurs to an Aggregate, identified by its type and id. Every Event has an eventTimestamp, generated by the source of the event. An Event History is a log of Events, ordered by eventTimestamp, with an additional processingTimestamp which records when the Event was captured.
  • 25. Network Event sources Event processors Events arrive: • Partitioned • Interleaved • Out-of-order Processing Model: Ordering
  • 26. Log is: • Partitioned by aggregate id • Ordered by event timestamp Processing Model: Ordering
  • 27. CREATE  TABLE  IF  NOT  EXISTS  concursus.Event ( aggregateType text, aggregateId text, eventTimestamp timestamp, streamId text, processingId timeuuid, name  text, version  text, parameters  map<text,  text>, characteristics  int, PRIMARY  KEY((aggregateType,  aggregateId),  eventTimestamp,   streamId) )  WITH  CLUSTERING  ORDER  BY  (eventTimestamp DESC); Cassandra Schema
  • 29. Cassandra Event Store RabbitMQ Topic Downstream processing out-of-order events ordered query results Cassandra & AMQP
  • 30. Cassandra Event Store Kafka Topic Downstream processing Event store listener Publish events Log events Cassandra & Kafka
  • 31. Processing Model: Summary Events arrive partitioned, interleaved and out-of-order. Events are sorted into event histories by aggregate type and id. Events are sorted within event histories by event timestamp, not processing timestamp. Event consumers need to take into account the possibility that an event history may be incomplete at the time it is read – consider using a watermark to give incoming events time to “settle”.
  • 32. Programming Model: Core Metaphor Received   at Depot Loaded   onto Truck Delivery Failed Received   at Depot Loaded   onto Truck Delivered
  • 33. Received   at Depot Loaded   onto Truck Delivery Failed Received   at Depot Loaded   onto Truck Delivered Consumer<Event> Programming Model: Core Metaphor
  • 34. You give me a Consumer<Event>, and I send Events to it one at a time: Emitting Events
  • 35. I implement Consumer<Event>, and handle Events that are sent to me. Handling Events
  • 39. Kotlin Mapping sealed  class  ParcelEvent { class  ReceivedAtDepot(val depotId:  String):  ParcelEvent() class  LoadedOntoTruck(val truckId:  String):  ParcelEvent() class  Delivered(val destinationId:  String):  ParcelEvent() class  DeliveryFailed():  ParcelEvent() }
  • 40. Kotlin Mapping eventBus.dispatchTo(parcelId, ReceivedAtDepot(depotId =  "Lewisham Depot")  at  start, LoadedOntoLorry(lorryId =  "Truck  CU50  ZCV")  at   start.plus(2,  DAYS) )
  • 41. Kotlin Mapping fun  describeEvent(event:  ParcelEvent):  Unit  =  when  (event)  { is  ReceivedAtDepot -­‐>  println("Received  at  depot:   ${event.depotId}") is  LoadedOntoTruck -­‐>  println("Loaded  onto  truck:   ${event.truckId}") is  Delivered  -­‐>  println("Delivered  to:   ${event.destinationId}") is  DeliveryFailed -­‐>  println("Delivery  failed") }
  • 42. Event-handling middleware is a chain of Consumer<Event>s that transforms, routes, persists and dispatches events. A single event submitted to this chain may be: ■ Checked against an idempotency filter (e.g. a Hazelcast distributed cache) ■ Serialised to JSON ■ Written to a message queue topic ■ Retrieved from the topic and deserialised ■ Persisted to an event store (e.g. Cassandra) ■ Published to an event handler which maintains a query-optimised view of part of the system ■ Published to an event handler which maintains an index of aggregates by event property values (e.g. lightbulbs by wattage) Event-Handling Middleware
  • 43. • Kafka Streams • Narrative threads across event histories • Generic Attribute indexing • State management and caching • Improved cloud tooling Future Directions
  • 44. Thank you for listening Any questions?