SlideShare a Scribd company logo
1 of 20
Download to read offline
TRANSACTIONAL EVENT SOURCING
USING SLICK
ADAM WARSKI
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
EVENT SOURCING?
▸ All changes in the system are captured as a sequence of events
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
WHY EVENT SOURCING?
▸ IT: Information Technology
▸ do not loose information!
▸ Audit log
▸ Re-create system state
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
ME + AUDIT = HIBERNATE ENVERS
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
ME
▸ coder @
▸ Lightbend consulting partner
▸ mainly Scala
▸ open-source: MacWire, ElasticMQ, Bootzooka, …
▸ http://www.warski.org / @adamwarski
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
THE GOAL
▸ Get the benefits of Event Sourcing …
▸ … still being able to leverage RDBMS features
▸ transactions
▸ schema
▸ SQL
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
OTHER APPROACHES
▸ Event Store (https://geteventstore.com)
▸ Akka Persistence (http://doc.akka.io/docs/akka/current)
▸ Eventuate (http://eventuate.io)
▸ + more
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
EVENTS
▸ Immutable
▸ Primary source of truth
▸ Past tense
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
EVENTS
▸ Payload: arbitrary json (case class)
▸ Event type (name of class)
▸ Aggregate type & id
▸ Id, timestamp
▸ Transaction id
▸ User id
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
HOW?
▸ Events are stored in a dedicated table
▸ Basing on events, a read model is updated
▸ similar to what a “traditional” CRUD model could be
▸ Consistency: both done in a single transaction
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
SLICK
▸ We operate on DBIOAction[T]
▸ a description of actions to be done
▸ execution deferred later
▸ can be sequenced using flatMap
▸ yes, it’s a Monad
User data
Transaction
READ MODEL
MODEL
UPDATE
EVENT
LISTENER
External systems
EVENT
PROCESSOR
REGISTRYREGISTRYREGISTRY
Events
COMMAND
EVENT SOURCING LIVE
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
POTENTIAL PROBLEMS
▸ Ordering of concurrent events operating on the same aggregate root
▸ DBIOAction “leaks”
▸ Future wrapping
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
SUMMING UP: FUNCTIONS INVOLVED
▸ Commands: Data => CommandResult[S, F]

that is, DBIOAction[(Either[S, F], List[Event])]
▸ Event listeners: Event => DBIOAction[List[Event]]
▸ Model updates: Event => DBIOAction[Unit]
ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI
LINKS
▸ https://github.com/softwaremill/slick-eventsourcing
▸ README+blog longer than code
▸ only a skeleton
▸ probably for customisation
▸ https://github.com/adamw/slick-eventsourcing-pres
THANK YOU!
Slick eventsourcing
Slick eventsourcing

More Related Content

What's hot

AWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Chicago
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 AppFelix Gessert
 
Building a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containersBuilding a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containersaslomibm
 
Build your operator with the right tool
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right toolRafał Leszko
 
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Felix Gessert
 
How ddd, cqrs and event sourcing constitute the architecture of the future
How ddd, cqrs and event sourcing constitute the architecture of the futureHow ddd, cqrs and event sourcing constitute the architecture of the future
How ddd, cqrs and event sourcing constitute the architecture of the futureMSDEVMTL
 
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLKafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLconfluent
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiRita Zhang
 
Reactive database access with Slick3
Reactive database access with Slick3Reactive database access with Slick3
Reactive database access with Slick3takezoe
 
Container World 2018
Container World 2018Container World 2018
Container World 2018aspyker
 
Building Out Your Kafka Developer CDC Ecosystem
Building Out Your Kafka Developer CDC  EcosystemBuilding Out Your Kafka Developer CDC  Ecosystem
Building Out Your Kafka Developer CDC Ecosystemconfluent
 
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB
 
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB AtlasWebinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB AtlasMongoDB
 
Event sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreEvent sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreShivji Kumar Jha
 
NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with JavaOtávio Santana
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Otávio Santana
 
Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSAntons Kranga
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGiCarsten Ziegeler
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overviewrajdeep
 

What's hot (20)

AWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, ChicagoAWS Step Function with API Gateway Integration - Metin Kale, Chicago
AWS Step Function with API Gateway Integration - Metin Kale, Chicago
 
Building an Angular 2 App
Building an Angular 2 AppBuilding an Angular 2 App
Building an Angular 2 App
 
Building a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containersBuilding a multi-tenant cloud service from legacy code with Docker containers
Building a multi-tenant cloud service from legacy code with Docker containers
 
Build your operator with the right tool
Build your operator with the right toolBuild your operator with the right tool
Build your operator with the right tool
 
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
 
How ddd, cqrs and event sourcing constitute the architecture of the future
How ddd, cqrs and event sourcing constitute the architecture of the futureHow ddd, cqrs and event sourcing constitute the architecture of the future
How ddd, cqrs and event sourcing constitute the architecture of the future
 
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQLKafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
Kafka Summit SF 2017 - Kafka Stream Processing for Everyone with KSQL
 
Kubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csiKubecon 2019_eu-k8s-secrets-csi
Kubecon 2019_eu-k8s-secrets-csi
 
Clocker and OpenStack
Clocker and OpenStackClocker and OpenStack
Clocker and OpenStack
 
Reactive database access with Slick3
Reactive database access with Slick3Reactive database access with Slick3
Reactive database access with Slick3
 
Container World 2018
Container World 2018Container World 2018
Container World 2018
 
Building Out Your Kafka Developer CDC Ecosystem
Building Out Your Kafka Developer CDC  EcosystemBuilding Out Your Kafka Developer CDC  Ecosystem
Building Out Your Kafka Developer CDC Ecosystem
 
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile AppsMongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
MongoDB .local Bengaluru 2019: Realm: The Secret Sauce for Better Mobile Apps
 
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB AtlasWebinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
Webinar: Serverless Architectures with AWS Lambda and MongoDB Atlas
 
Event sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event StoreEvent sourcing Live 2021: Streaming App Changes to Event Store
Event sourcing Live 2021: Streaming App Changes to Event Store
 
NoSQL design pitfalls with Java
NoSQL design pitfalls with JavaNoSQL design pitfalls with Java
NoSQL design pitfalls with Java
 
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
Modern Cloud-Native Jakarta EE Frameworks: tips, challenges, and trends.
 
Riga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWSRiga dev day: Lambda architecture at AWS
Riga dev day: Lambda architecture at AWS
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGi
 
Openstack Overview
Openstack OverviewOpenstack Overview
Openstack Overview
 

Similar to Slick eventsourcing

Windowing data in big data streams
Windowing data in big data streamsWindowing data in big data streams
Windowing data in big data streamsSoftwareMill
 
Using Behavior to Protect Cloud Servers
Using Behavior to Protect Cloud ServersUsing Behavior to Protect Cloud Servers
Using Behavior to Protect Cloud Serversbanerjeea
 
The Serverless Cloud @ JAX London 2016
The Serverless Cloud @ JAX London 2016The Serverless Cloud @ JAX London 2016
The Serverless Cloud @ JAX London 2016Bart Blommaerts
 
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS Chicago
 
ITB2019 Serverless CFML on AWS Lambda - Pete Freitag
ITB2019  Serverless CFML on AWS Lambda - Pete FreitagITB2019  Serverless CFML on AWS Lambda - Pete Freitag
ITB2019 Serverless CFML on AWS Lambda - Pete FreitagOrtus Solutions, Corp
 
Stockholm Serverless Meetup - Serverless Challenges
Stockholm Serverless Meetup - Serverless ChallengesStockholm Serverless Meetup - Serverless Challenges
Stockholm Serverless Meetup - Serverless Challengesİbrahim Gürses
 
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"Fwdays
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudConor Svensson
 
Technical Architecture of RASP Technology
Technical Architecture of RASP TechnologyTechnical Architecture of RASP Technology
Technical Architecture of RASP TechnologyPriyanka Aash
 
RVASec AWS Survival Guide 2.0
RVASec AWS Survival Guide 2.0RVASec AWS Survival Guide 2.0
RVASec AWS Survival Guide 2.0Ken Johnson
 
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018ChrisJohnsonBidler
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSAmine Sadry
 
Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in ComparisonJava in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparisonadesso AG
 
Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparison Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparison Eberhard Wolff
 
Streaming Analytics for Financial Enterprises
Streaming Analytics for Financial EnterprisesStreaming Analytics for Financial Enterprises
Streaming Analytics for Financial EnterprisesDatabricks
 
Going Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGoing Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGeorge Tourkas
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudConor Svensson
 

Similar to Slick eventsourcing (20)

Windowing data in big data streams
Windowing data in big data streamsWindowing data in big data streams
Windowing data in big data streams
 
Using Behavior to Protect Cloud Servers
Using Behavior to Protect Cloud ServersUsing Behavior to Protect Cloud Servers
Using Behavior to Protect Cloud Servers
 
The Serverless Cloud @ JAX London 2016
The Serverless Cloud @ JAX London 2016The Serverless Cloud @ JAX London 2016
The Serverless Cloud @ JAX London 2016
 
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
AWS user group Serverless in September - Chris Johnson Bidler "Go Serverless ...
 
ITB2019 Serverless CFML on AWS Lambda - Pete Freitag
ITB2019  Serverless CFML on AWS Lambda - Pete FreitagITB2019  Serverless CFML on AWS Lambda - Pete Freitag
ITB2019 Serverless CFML on AWS Lambda - Pete Freitag
 
Viadeo - The Kasper way
Viadeo - The Kasper wayViadeo - The Kasper way
Viadeo - The Kasper way
 
Stockholm Serverless Meetup - Serverless Challenges
Stockholm Serverless Meetup - Serverless ChallengesStockholm Serverless Meetup - Serverless Challenges
Stockholm Serverless Meetup - Serverless Challenges
 
Big Data on AWS
Big Data on AWSBig Data on AWS
Big Data on AWS
 
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring Cloud
 
GopherCon Gilmour
GopherCon GilmourGopherCon Gilmour
GopherCon Gilmour
 
Technical Architecture of RASP Technology
Technical Architecture of RASP TechnologyTechnical Architecture of RASP Technology
Technical Architecture of RASP Technology
 
RVASec AWS Survival Guide 2.0
RVASec AWS Survival Guide 2.0RVASec AWS Survival Guide 2.0
RVASec AWS Survival Guide 2.0
 
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018
Serverless Chicago - Datomic Cloud and AWS AppSync - April 26 2018
 
Cloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWSCloud 101: Hands-on Heroku & AWS
Cloud 101: Hands-on Heroku & AWS
 
Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in ComparisonJava in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparison
 
Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparison Java in the Cloud : PaaS Platforms in Comparison
Java in the Cloud : PaaS Platforms in Comparison
 
Streaming Analytics for Financial Enterprises
Streaming Analytics for Financial EnterprisesStreaming Analytics for Financial Enterprises
Streaming Analytics for Financial Enterprises
 
Going Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAMGoing Serverless on AWS with Golang and SAM
Going Serverless on AWS with Golang and SAM
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring Cloud
 

More from Adam Warski

What have the annotations done to us?
What have the annotations done to us?What have the annotations done to us?
What have the annotations done to us?Adam Warski
 
Hejdyk maleńka część mazur
Hejdyk maleńka część mazurHejdyk maleńka część mazur
Hejdyk maleńka część mazurAdam Warski
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesAdam Warski
 
The no-framework Scala Dependency Injection Framework
The no-framework Scala Dependency Injection FrameworkThe no-framework Scala Dependency Injection Framework
The no-framework Scala Dependency Injection FrameworkAdam Warski
 
ElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverAdam Warski
 
The ideal module system and the harsh reality
The ideal module system and the harsh realityThe ideal module system and the harsh reality
The ideal module system and the harsh realityAdam Warski
 
Recommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionRecommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionAdam Warski
 
CDI Portable Extensions
CDI Portable ExtensionsCDI Portable Extensions
CDI Portable ExtensionsAdam Warski
 

More from Adam Warski (9)

What have the annotations done to us?
What have the annotations done to us?What have the annotations done to us?
What have the annotations done to us?
 
Hejdyk maleńka część mazur
Hejdyk maleńka część mazurHejdyk maleńka część mazur
Hejdyk maleńka część mazur
 
Evaluating persistent, replicated message queues
Evaluating persistent, replicated message queuesEvaluating persistent, replicated message queues
Evaluating persistent, replicated message queues
 
The no-framework Scala Dependency Injection Framework
The no-framework Scala Dependency Injection FrameworkThe no-framework Scala Dependency Injection Framework
The no-framework Scala Dependency Injection Framework
 
ElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS serverElasticMQ: a fully asynchronous, Akka-based SQS server
ElasticMQ: a fully asynchronous, Akka-based SQS server
 
The ideal module system and the harsh reality
The ideal module system and the harsh realityThe ideal module system and the harsh reality
The ideal module system and the harsh reality
 
Recommendation systems with Mahout: introduction
Recommendation systems with Mahout: introductionRecommendation systems with Mahout: introduction
Recommendation systems with Mahout: introduction
 
Scala Macros
Scala MacrosScala Macros
Scala Macros
 
CDI Portable Extensions
CDI Portable ExtensionsCDI Portable Extensions
CDI Portable Extensions
 

Recently uploaded

VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 

Recently uploaded (20)

VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 

Slick eventsourcing

  • 2.
  • 3. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI EVENT SOURCING? ▸ All changes in the system are captured as a sequence of events
  • 4. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI WHY EVENT SOURCING? ▸ IT: Information Technology ▸ do not loose information! ▸ Audit log ▸ Re-create system state
  • 5. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI ME + AUDIT = HIBERNATE ENVERS
  • 6. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI ME ▸ coder @ ▸ Lightbend consulting partner ▸ mainly Scala ▸ open-source: MacWire, ElasticMQ, Bootzooka, … ▸ http://www.warski.org / @adamwarski
  • 7. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI THE GOAL ▸ Get the benefits of Event Sourcing … ▸ … still being able to leverage RDBMS features ▸ transactions ▸ schema ▸ SQL
  • 8. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI OTHER APPROACHES ▸ Event Store (https://geteventstore.com) ▸ Akka Persistence (http://doc.akka.io/docs/akka/current) ▸ Eventuate (http://eventuate.io) ▸ + more
  • 9. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI EVENTS ▸ Immutable ▸ Primary source of truth ▸ Past tense
  • 10. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI EVENTS ▸ Payload: arbitrary json (case class) ▸ Event type (name of class) ▸ Aggregate type & id ▸ Id, timestamp ▸ Transaction id ▸ User id
  • 11. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI HOW? ▸ Events are stored in a dedicated table ▸ Basing on events, a read model is updated ▸ similar to what a “traditional” CRUD model could be ▸ Consistency: both done in a single transaction
  • 12. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI SLICK ▸ We operate on DBIOAction[T] ▸ a description of actions to be done ▸ execution deferred later ▸ can be sequenced using flatMap ▸ yes, it’s a Monad
  • 13. User data Transaction READ MODEL MODEL UPDATE EVENT LISTENER External systems EVENT PROCESSOR REGISTRYREGISTRYREGISTRY Events COMMAND
  • 15. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI POTENTIAL PROBLEMS ▸ Ordering of concurrent events operating on the same aggregate root ▸ DBIOAction “leaks” ▸ Future wrapping
  • 16. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI SUMMING UP: FUNCTIONS INVOLVED ▸ Commands: Data => CommandResult[S, F]
 that is, DBIOAction[(Either[S, F], List[Event])] ▸ Event listeners: Event => DBIOAction[List[Event]] ▸ Model updates: Event => DBIOAction[Unit]
  • 17. ADAM WARSKI, SOFTWAREMILL @ADAMWARSKI LINKS ▸ https://github.com/softwaremill/slick-eventsourcing ▸ README+blog longer than code ▸ only a skeleton ▸ probably for customisation ▸ https://github.com/adamw/slick-eventsourcing-pres