SlideShare a Scribd company logo
DevOps und
Experimentieren –
aber wie?
Event Sourcing und CQRS
Björn Senft b.senft@sicp.upb.de
16.01.2018
Experiments
are not
feasible!
• Risk to change a running system is too high!
• Huge effort to host several alternatives!
• Experiments produce insights on which we can‘t react
fast enough!
• Our technology stack doesn‘t support your idea!
• Running experiments cost too much (e. g.
implementation, seperate logging, assign experiments
to users)!
• Experiments aren‘t mature and crash the whole system!
• We can support only one version of the API at once!
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft4
https://medium.com/netflix-techblog/its-all-a-bout-testing-the-netflix-
experimentation-platform-4e1ca458c15
DevOps and
Experiments
- Optimal
combo?
DevOps Goals
• Achieve accelerated and more frequent deployment of
changes to Production
• Feedback from real users as early and frequently as
possible
Continuous Delivery
• Quick deployment of components
• Automatic rollback (triggered manually / automatic)
Microservices (Philosophy)
• Non-Deployment Monoliths
• Small components (3 months / small team)
• Technology independent
• Allows different versions at runtime
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft6
Microservice
+
Continuous
Delivery
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft7
https://www.nginx.com/blog/introduction-to-
microservices/
http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment
Bounded
Context
Allow
• easier change of requirements
Need
• parallel models -> needs synchronisation16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft8
https://www.martinfowler.com/bliki/BoundedContext.html
Event
Sourcing
and CQRS
help
Event Sourcing
• Creation and synchronisation of parallel models
• Resilience
• Change Log
CQRS
• Separate write side from read side
• Supports parallel models (e. g. allowing only one serivce to
write data, but other services to reuse them in a way they
need)
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft9
Wer hat schon mal Event
Sourcing verwendet?
Transaction Log
© Röth, Frank
Active Record
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
Load
AccountBalance
Aggregate for Account 501
0.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
AccountBalance
Aggregate for Account 502
0.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft12
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
Load
AccountBalance
Aggregate for Account 501
0.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
Query results
AccountBalance
Aggregate for Account 502
300.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft13
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
AccountBalance
Aggregate for Account 501
0.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
AccountBalance
Aggregate for Account 502
300.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft14
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
AccountBalance
Aggregate for Account 501
0.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
AccountBalance
Aggregate for Account 502
300.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft15
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
AccountBalance
Aggregate for Account 501
100.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
AccountBalance
Aggregate for Account 502
200.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft16
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
Save
AccountBalance
Aggregate for Account 501
100.00
ID Account Owner Balance
… … …
501 Björn Senft 0.00
502 Simon Oberthür 300.00
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
AccountBalance
Aggregate for Account 502
200.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft17
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
AccountBalance
Aggregate for Account 501
100.00
ID Account Owner Balance
… … …
501 Björn Senft 100.00
502 Simon Oberthür 200.00
Update statement
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
AccountBalance
Aggregate for Account 502
200.00
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft18
Active
Record
Example: Bank Account
Domain Model
ORM
Layer
RDBMS
AccountBalance
Aggregate for Account 501
2550.00
ID Account Owner Balance
… … …
501 Björn Senft 2550.00
502 Simon Oberthür -15,300.00
AccountBalance
Aggregate for Account 502
-15,300.00
Simon Björn
What
happened?
What
happened?
Disadvantage: No history of changes!
Here: No reasoning about transactions in the past
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft20
Object-
relational
impedance
mismatch
• 143 pages on mapping
objects to tables
• Recommends using ORM-
Tools only for CRUD-heavy
applications
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft22
Event Sourcing
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
0.00
Event Store
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
Query
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft24
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
300.00
Event Store
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft25
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
300.00
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
Event Store
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft26
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
300.00
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
Event Store
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft27
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
300.00
Command Handler
Command:
Transfer 100€ from
Simon Oberthür to Björn Senft
Event Store
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft28
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
0.00
AccountBalance
Aggregate for Account 502
300.00
Command Handler
Command:
Event Store
Received100€from
Acc502
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
Append Transfer 100€ from
Simon Oberthür to Björn Senft
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft29
Event
Sourcing
Example: Bank Account
Domain Model
AccountBalance
Aggregate for Account 501
100.00
AccountBalance
Aggregate for Account 502
200.00
Command Handler
Command:
Event Store
Received100€from
Acc502
Debit100€
Credit200€
…
Credit50€
Debit500€
Events
belonging to
Account 501
Query
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft30
Saving and
Restoring
Saving
• Create an event for every state
change of the object
• Persist this stream of events,
preserving event order
BankAccountCreated
Id: 501
Owner: Björn Senft
DepositPerformed
AccountId: 501
Amount: 20€
OwnerChanged
AccountId: 501
NewOwner: Simon Oberthür
WithdrawalPerformed
AccountId: 501
Amount: 10€16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft33
Saving and
Restoring
Saving Restoring
• Create an event for every state
change of the object
• Persist this stream of events,
preserving event order
• Subsequently apply the events
from the respective EventStream
to a "blank" object instance
BankAccountCreated
Id: 501
Owner: Björn Senft
DepositPerformed
AccountId: 501
Amount: 20€
OwnerChanged
AccountId: 501
NewOwner: Simon Oberthür
WithdrawalPerformed
AccountId: 501
Amount: 10€
BankAccount
Empty
apply to
BankAccount
Id: 501
Owner: Björn Senft
Balance: 0€
produces
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft34
Saving and
Restoring
Saving Restoring
• Create an event for every state
change of the object
• Persist this stream of events,
preserving event order
• Subsequently apply the events
from the respective EventStream
to a "blank" object instance
BankAccountCreated
Id: 501
Owner: Björn Senft
DepositPerformed
AccountId: 501
Amount: 20€
OwnerChanged
AccountId: 501
NewOwner: Simon Oberthür
WithdrawalPerformed
AccountId: 501
Amount: 10€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 0€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 20€
BankAccount
Empty
apply to
apply to
produces
produces
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft35
Saving and
Restoring
Saving Restoring
• Create an event for every state
change of the object
• Persist this stream of events,
preserving event order
• Subsequently apply the events
from the respective EventStream
to a "blank" object instance
BankAccountCreated
Id: 501
Owner: Björn Senft
DepositPerformed
AccountId: 501
Amount: 20€
OwnerChanged
AccountId: 501
NewOwner: Simon Oberthür
WithdrawalPerformed
AccountId: 501
Amount: 10€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 0€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 20€
BankAccount
Id: 501
Owner: Simon Oberthür
Balance: 20€
BankAccount
Empty
apply to
apply to
apply to
produces
produces
produces
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft36
Saving and
Restoring
Saving Restoring
• Create an event for every state
change of the object
• Persist this stream of events,
preserving event order
• Subsequently apply the events
from the respective EventStream
to a "blank" object instance
BankAccountCreated
Id: 501
Owner: Björn Senft
DepositPerformed
AccountId: 501
Amount: 20€
OwnerChanged
AccountId: 501
NewOwner: Simon Oberthür
WithdrawalPerformed
AccountId: 501
Amount: 10€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 0€
BankAccount
Id: 501
Owner: Björn Senft
Balance: 20€
BankAccount
Id: 501
Owner: Simon Oberthür
Balance: 20€
BankAccount
Id: 501
Owner: Simon Oberthür
Balance: 10€
BankAccount
Empty
apply to
apply to
apply to
apply to
produces
produces
produces
produces
Deleting?
Retroactive Event! An event undoing something that happened in the past.
BankAccountClosed
reason
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft37
Pros and
Cons
General Advantages
• High Scalability
• Transparency as every change is recorded
• Deterministic error search
General Disadvantages
• High software development effort
• “Packaging up every change to an application as an
event is an interface style that not everyone is
comfortable with, and many find to be awkward” ?
• „Querying on a lot of events“
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft39
CQRS
Command Query Responsibility Segregation
CQRS
Service
Interfaces
Read Side
Write Side
Event Store
Publishes Events after
they have been saved
Denormalized Read Store
Subscribes to Events
on the Write Side
Query
Append
events
Events
Query response
User views data
in the UI
User makes a
change in the UI
Command
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft41
Pros and
Cons
General Advantages
• High Scalability
• Optimal for SOA / Cloud Computing
• Read and Write access can scale indepently
• Split up development for teams
General Disadvantages
• High software development effort
• Needs a fitting infrastructure
• Transactions are challenging
• You can query before a command was executed
(Eventual Consistency)
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft42
ES+CQRS in
practice
Example: HiP-App
„Microservices“
Parallel Models
CMS
CMS
AngularApp
DataStore
CMS
Web API
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft43
Conclusion
ES + CQRS
for
experiments
Different versions at runtime
• Bounded contexts
• Parallel models
• Separation of read and write side
Logging
• ES stores every state change by default
• User interactions can directly be logged into ES
Microservices
• Lower complexity
• Easier change of requirements
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft45
Experiments
are not
feasible!
• Risk to change a running system is too high!
• Huge effort to host several alternatives!
• Experiments produce insights on which we can‘t react
fast enough!
• Our technology stack doesn‘t support your idea!
• Running experiments cost too much (e. g.
implementation, seperate logging, assign experiments
to users)!
• Experiments aren‘t mature and crash the whole system!
• We can support only one version of the API at once!
16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft46
DevOps - Experimentieren aber wie? - Björn Senft

More Related Content

Similar to DevOps - Experimentieren aber wie? - Björn Senft

Denise Brown Sql Porfolio
Denise Brown Sql PorfolioDenise Brown Sql Porfolio
Denise Brown Sql Porfolio
bibbab1
 
Office 365 and share point online ramp up in 60 minutes for on-premises share...
Office 365 and share point online ramp up in 60 minutes for on-premises share...Office 365 and share point online ramp up in 60 minutes for on-premises share...
Office 365 and share point online ramp up in 60 minutes for on-premises share...
Nik Patel
 
Real Time Analytics On AWS: Optimized Architectures
Real Time Analytics On AWS: Optimized ArchitecturesReal Time Analytics On AWS: Optimized Architectures
Real Time Analytics On AWS: Optimized Architectures
Amazon Web Services
 
Architecture Evolution 2018
Architecture Evolution 2018Architecture Evolution 2018
Architecture Evolution 2018
Sebastian Schleicher
 
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
ERP - Eye Bright
 
Bank Reconsiliation Configuration
Bank Reconsiliation Configuration Bank Reconsiliation Configuration
Bank Reconsiliation Configuration
Damodar Naidu Paladugu
 
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP FinancialsOvercoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
SAPinsider Events
 
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
BCS ProSoft
 
Getting Started: Power BI Essentials
Getting Started: Power BI EssentialsGetting Started: Power BI Essentials
Getting Started: Power BI Essentials
Senturus
 
D365UG London March 2019 - Auditing and Security in the Dynamics platform
D365UG London March 2019 - Auditing and Security in the Dynamics platformD365UG London March 2019 - Auditing and Security in the Dynamics platform
D365UG London March 2019 - Auditing and Security in the Dynamics platform
Ramon Tebar
 
ROI and Economic Value of Data Virtualization
ROI and Economic Value of Data VirtualizationROI and Economic Value of Data Virtualization
ROI and Economic Value of Data Virtualization
Denodo
 
Quick Note Presentation
Quick Note PresentationQuick Note Presentation
Quick Note Presentation
Aideen Leacy
 
Sql Server 2008 Portfolio
Sql Server 2008 PortfolioSql Server 2008 Portfolio
Sql Server 2008 Portfolio
Eugene Kilpatrick
 
Webinar: Microsoft ignite 2020 Key Takeaways
Webinar: Microsoft ignite 2020  Key TakeawaysWebinar: Microsoft ignite 2020  Key Takeaways
Webinar: Microsoft ignite 2020 Key Takeaways
Withum
 
Assessing the Sales Margins in New business models
Assessing the Sales Margins in New business modelsAssessing the Sales Margins in New business models
Assessing the Sales Margins in New business models
Jos Feyaerts
 
How will automation make our jobs easier? webinar, 17 January 2020
How will automation make our jobs easier? webinar, 17 January 2020How will automation make our jobs easier? webinar, 17 January 2020
How will automation make our jobs easier? webinar, 17 January 2020
Association for Project Management
 
213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.key213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.key
NAVER D2
 
Workday Integration Online Training.pdf
Workday Integration Online Training.pdfWorkday Integration Online Training.pdf
Workday Integration Online Training.pdf
SpiritsoftsTraining
 
Hbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibanaHbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibana
Allen Chan
 
Got SIEM? Now what? Getting SIEM Work For You
Got SIEM? Now what? Getting SIEM Work For YouGot SIEM? Now what? Getting SIEM Work For You
Got SIEM? Now what? Getting SIEM Work For You
Anton Chuvakin
 

Similar to DevOps - Experimentieren aber wie? - Björn Senft (20)

Denise Brown Sql Porfolio
Denise Brown Sql PorfolioDenise Brown Sql Porfolio
Denise Brown Sql Porfolio
 
Office 365 and share point online ramp up in 60 minutes for on-premises share...
Office 365 and share point online ramp up in 60 minutes for on-premises share...Office 365 and share point online ramp up in 60 minutes for on-premises share...
Office 365 and share point online ramp up in 60 minutes for on-premises share...
 
Real Time Analytics On AWS: Optimized Architectures
Real Time Analytics On AWS: Optimized ArchitecturesReal Time Analytics On AWS: Optimized Architectures
Real Time Analytics On AWS: Optimized Architectures
 
Architecture Evolution 2018
Architecture Evolution 2018Architecture Evolution 2018
Architecture Evolution 2018
 
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
 
Bank Reconsiliation Configuration
Bank Reconsiliation Configuration Bank Reconsiliation Configuration
Bank Reconsiliation Configuration
 
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP FinancialsOvercoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
Overcoming the Top 7 Intercompany Accounting Challenges in SAP ERP Financials
 
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
What's New in Deltek Vision 7.1, Invoice Approvals, Overhead Allocation and 5...
 
Getting Started: Power BI Essentials
Getting Started: Power BI EssentialsGetting Started: Power BI Essentials
Getting Started: Power BI Essentials
 
D365UG London March 2019 - Auditing and Security in the Dynamics platform
D365UG London March 2019 - Auditing and Security in the Dynamics platformD365UG London March 2019 - Auditing and Security in the Dynamics platform
D365UG London March 2019 - Auditing and Security in the Dynamics platform
 
ROI and Economic Value of Data Virtualization
ROI and Economic Value of Data VirtualizationROI and Economic Value of Data Virtualization
ROI and Economic Value of Data Virtualization
 
Quick Note Presentation
Quick Note PresentationQuick Note Presentation
Quick Note Presentation
 
Sql Server 2008 Portfolio
Sql Server 2008 PortfolioSql Server 2008 Portfolio
Sql Server 2008 Portfolio
 
Webinar: Microsoft ignite 2020 Key Takeaways
Webinar: Microsoft ignite 2020  Key TakeawaysWebinar: Microsoft ignite 2020  Key Takeaways
Webinar: Microsoft ignite 2020 Key Takeaways
 
Assessing the Sales Margins in New business models
Assessing the Sales Margins in New business modelsAssessing the Sales Margins in New business models
Assessing the Sales Margins in New business models
 
How will automation make our jobs easier? webinar, 17 January 2020
How will automation make our jobs easier? webinar, 17 January 2020How will automation make our jobs easier? webinar, 17 January 2020
How will automation make our jobs easier? webinar, 17 January 2020
 
213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.key213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.key
 
Workday Integration Online Training.pdf
Workday Integration Online Training.pdfWorkday Integration Online Training.pdf
Workday Integration Online Training.pdf
 
Hbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibanaHbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibana
 
Got SIEM? Now what? Getting SIEM Work For You
Got SIEM? Now what? Getting SIEM Work For YouGot SIEM? Now what? Getting SIEM Work For You
Got SIEM? Now what? Getting SIEM Work For You
 

More from Mark Lechtermann

Knative with .NET Core and Quarkus with GraalVM
Knative with .NET Core and Quarkus with GraalVMKnative with .NET Core and Quarkus with GraalVM
Knative with .NET Core and Quarkus with GraalVM
Mark Lechtermann
 
GraphQL with .NET Core
GraphQL with .NET CoreGraphQL with .NET Core
GraphQL with .NET Core
Mark Lechtermann
 
Microsoft Connect 2018 .NET User Group Paderborn
Microsoft Connect 2018 .NET User Group PaderbornMicrosoft Connect 2018 .NET User Group Paderborn
Microsoft Connect 2018 .NET User Group Paderborn
Mark Lechtermann
 
MQTT with .NET Core
MQTT with .NET CoreMQTT with .NET Core
MQTT with .NET Core
Mark Lechtermann
 
Electron
ElectronElectron
Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0
Mark Lechtermann
 
DevOps: Automatisierte Deployments mit TFS & Octopus Deploy
DevOps: Automatisierte Deployments mit TFS & Octopus DeployDevOps: Automatisierte Deployments mit TFS & Octopus Deploy
DevOps: Automatisierte Deployments mit TFS & Octopus Deploy
Mark Lechtermann
 
6. Treffen der .NET User Group Paderborn
6. Treffen der .NET User Group Paderborn6. Treffen der .NET User Group Paderborn
6. Treffen der .NET User Group Paderborn
Mark Lechtermann
 
5. Treffen der .NET User Group Paderborn
5. Treffen der .NET User Group Paderborn5. Treffen der .NET User Group Paderborn
5. Treffen der .NET User Group Paderborn
Mark Lechtermann
 

More from Mark Lechtermann (9)

Knative with .NET Core and Quarkus with GraalVM
Knative with .NET Core and Quarkus with GraalVMKnative with .NET Core and Quarkus with GraalVM
Knative with .NET Core and Quarkus with GraalVM
 
GraphQL with .NET Core
GraphQL with .NET CoreGraphQL with .NET Core
GraphQL with .NET Core
 
Microsoft Connect 2018 .NET User Group Paderborn
Microsoft Connect 2018 .NET User Group PaderbornMicrosoft Connect 2018 .NET User Group Paderborn
Microsoft Connect 2018 .NET User Group Paderborn
 
MQTT with .NET Core
MQTT with .NET CoreMQTT with .NET Core
MQTT with .NET Core
 
Electron
ElectronElectron
Electron
 
Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0
 
DevOps: Automatisierte Deployments mit TFS & Octopus Deploy
DevOps: Automatisierte Deployments mit TFS & Octopus DeployDevOps: Automatisierte Deployments mit TFS & Octopus Deploy
DevOps: Automatisierte Deployments mit TFS & Octopus Deploy
 
6. Treffen der .NET User Group Paderborn
6. Treffen der .NET User Group Paderborn6. Treffen der .NET User Group Paderborn
6. Treffen der .NET User Group Paderborn
 
5. Treffen der .NET User Group Paderborn
5. Treffen der .NET User Group Paderborn5. Treffen der .NET User Group Paderborn
5. Treffen der .NET User Group Paderborn
 

Recently uploaded

7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
Toptal Tech
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
uehowe
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
xjq03c34
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
AanSulistiyo
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
Paul Walk
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
bseovas
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
davidjhones387
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
saathvikreddy2003
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
uehowe
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
fovkoyb
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
wolfsoftcompanyco
 

Recently uploaded (20)

7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!Ready to Unlock the Power of Blockchain!
Ready to Unlock the Power of Blockchain!
 
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
留学挂科(UofM毕业证)明尼苏达大学毕业证成绩单复刻办理
 
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
办理新西兰奥克兰大学毕业证学位证书范本原版一模一样
 
Azure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdfAzure EA Sponsorship - Customer Guide.pdf
Azure EA Sponsorship - Customer Guide.pdf
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?Should Repositories Participate in the Fediverse?
Should Repositories Participate in the Fediverse?
 
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
不能毕业如何获得(USYD毕业证)悉尼大学毕业证成绩单一比一原版制作
 
Discover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to IndiaDiscover the benefits of outsourcing SEO to India
Discover the benefits of outsourcing SEO to India
 
Design Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptxDesign Thinking NETFLIX using all techniques.pptx
Design Thinking NETFLIX using all techniques.pptx
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
办理毕业证(UPenn毕业证)宾夕法尼亚大学毕业证成绩单快速办理
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
存档可查的(USC毕业证)南加利福尼亚大学毕业证成绩单制做办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalmanuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
manuaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal
 

DevOps - Experimentieren aber wie? - Björn Senft

  • 1. DevOps und Experimentieren – aber wie? Event Sourcing und CQRS Björn Senft b.senft@sicp.upb.de 16.01.2018
  • 2. Experiments are not feasible! • Risk to change a running system is too high! • Huge effort to host several alternatives! • Experiments produce insights on which we can‘t react fast enough! • Our technology stack doesn‘t support your idea! • Running experiments cost too much (e. g. implementation, seperate logging, assign experiments to users)! • Experiments aren‘t mature and crash the whole system! • We can support only one version of the API at once! 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft4
  • 4. DevOps and Experiments - Optimal combo? DevOps Goals • Achieve accelerated and more frequent deployment of changes to Production • Feedback from real users as early and frequently as possible Continuous Delivery • Quick deployment of components • Automatic rollback (triggered manually / automatic) Microservices (Philosophy) • Non-Deployment Monoliths • Small components (3 months / small team) • Technology independent • Allows different versions at runtime 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft6
  • 5. Microservice + Continuous Delivery 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft7 https://www.nginx.com/blog/introduction-to- microservices/ http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment
  • 6. Bounded Context Allow • easier change of requirements Need • parallel models -> needs synchronisation16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft8 https://www.martinfowler.com/bliki/BoundedContext.html
  • 7. Event Sourcing and CQRS help Event Sourcing • Creation and synchronisation of parallel models • Resilience • Change Log CQRS • Separate write side from read side • Supports parallel models (e. g. allowing only one serivce to write data, but other services to reuse them in a way they need) 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft9
  • 8. Wer hat schon mal Event Sourcing verwendet? Transaction Log © Röth, Frank
  • 10. Active Record Example: Bank Account Domain Model ORM Layer RDBMS Load AccountBalance Aggregate for Account 501 0.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 AccountBalance Aggregate for Account 502 0.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft12
  • 11. Active Record Example: Bank Account Domain Model ORM Layer RDBMS Load AccountBalance Aggregate for Account 501 0.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 Query results AccountBalance Aggregate for Account 502 300.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft13
  • 12. Active Record Example: Bank Account Domain Model ORM Layer RDBMS AccountBalance Aggregate for Account 501 0.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 Command: Transfer 100€ from Simon Oberthür to Björn Senft AccountBalance Aggregate for Account 502 300.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft14
  • 13. Active Record Example: Bank Account Domain Model ORM Layer RDBMS AccountBalance Aggregate for Account 501 0.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft AccountBalance Aggregate for Account 502 300.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft15
  • 14. Active Record Example: Bank Account Domain Model ORM Layer RDBMS AccountBalance Aggregate for Account 501 100.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft AccountBalance Aggregate for Account 502 200.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft16
  • 15. Active Record Example: Bank Account Domain Model ORM Layer RDBMS Save AccountBalance Aggregate for Account 501 100.00 ID Account Owner Balance … … … 501 Björn Senft 0.00 502 Simon Oberthür 300.00 Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft AccountBalance Aggregate for Account 502 200.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft17
  • 16. Active Record Example: Bank Account Domain Model ORM Layer RDBMS AccountBalance Aggregate for Account 501 100.00 ID Account Owner Balance … … … 501 Björn Senft 100.00 502 Simon Oberthür 200.00 Update statement Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft AccountBalance Aggregate for Account 502 200.00 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft18
  • 17. Active Record Example: Bank Account Domain Model ORM Layer RDBMS AccountBalance Aggregate for Account 501 2550.00 ID Account Owner Balance … … … 501 Björn Senft 2550.00 502 Simon Oberthür -15,300.00 AccountBalance Aggregate for Account 502 -15,300.00 Simon Björn What happened? What happened? Disadvantage: No history of changes! Here: No reasoning about transactions in the past 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft20
  • 18. Object- relational impedance mismatch • 143 pages on mapping objects to tables • Recommends using ORM- Tools only for CRUD-heavy applications 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft22
  • 20. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 0.00 Event Store Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 Query 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft24
  • 21. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 300.00 Event Store Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft25
  • 22. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 300.00 Command: Transfer 100€ from Simon Oberthür to Björn Senft Event Store Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft26
  • 23. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 300.00 Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft Event Store Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft27
  • 24. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 300.00 Command Handler Command: Transfer 100€ from Simon Oberthür to Björn Senft Event Store Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft28
  • 25. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 0.00 AccountBalance Aggregate for Account 502 300.00 Command Handler Command: Event Store Received100€from Acc502 Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 Append Transfer 100€ from Simon Oberthür to Björn Senft 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft29
  • 26. Event Sourcing Example: Bank Account Domain Model AccountBalance Aggregate for Account 501 100.00 AccountBalance Aggregate for Account 502 200.00 Command Handler Command: Event Store Received100€from Acc502 Debit100€ Credit200€ … Credit50€ Debit500€ Events belonging to Account 501 Query 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft30
  • 27. Saving and Restoring Saving • Create an event for every state change of the object • Persist this stream of events, preserving event order BankAccountCreated Id: 501 Owner: Björn Senft DepositPerformed AccountId: 501 Amount: 20€ OwnerChanged AccountId: 501 NewOwner: Simon Oberthür WithdrawalPerformed AccountId: 501 Amount: 10€16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft33
  • 28. Saving and Restoring Saving Restoring • Create an event for every state change of the object • Persist this stream of events, preserving event order • Subsequently apply the events from the respective EventStream to a "blank" object instance BankAccountCreated Id: 501 Owner: Björn Senft DepositPerformed AccountId: 501 Amount: 20€ OwnerChanged AccountId: 501 NewOwner: Simon Oberthür WithdrawalPerformed AccountId: 501 Amount: 10€ BankAccount Empty apply to BankAccount Id: 501 Owner: Björn Senft Balance: 0€ produces 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft34
  • 29. Saving and Restoring Saving Restoring • Create an event for every state change of the object • Persist this stream of events, preserving event order • Subsequently apply the events from the respective EventStream to a "blank" object instance BankAccountCreated Id: 501 Owner: Björn Senft DepositPerformed AccountId: 501 Amount: 20€ OwnerChanged AccountId: 501 NewOwner: Simon Oberthür WithdrawalPerformed AccountId: 501 Amount: 10€ BankAccount Id: 501 Owner: Björn Senft Balance: 0€ BankAccount Id: 501 Owner: Björn Senft Balance: 20€ BankAccount Empty apply to apply to produces produces 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft35
  • 30. Saving and Restoring Saving Restoring • Create an event for every state change of the object • Persist this stream of events, preserving event order • Subsequently apply the events from the respective EventStream to a "blank" object instance BankAccountCreated Id: 501 Owner: Björn Senft DepositPerformed AccountId: 501 Amount: 20€ OwnerChanged AccountId: 501 NewOwner: Simon Oberthür WithdrawalPerformed AccountId: 501 Amount: 10€ BankAccount Id: 501 Owner: Björn Senft Balance: 0€ BankAccount Id: 501 Owner: Björn Senft Balance: 20€ BankAccount Id: 501 Owner: Simon Oberthür Balance: 20€ BankAccount Empty apply to apply to apply to produces produces produces 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft36
  • 31. Saving and Restoring Saving Restoring • Create an event for every state change of the object • Persist this stream of events, preserving event order • Subsequently apply the events from the respective EventStream to a "blank" object instance BankAccountCreated Id: 501 Owner: Björn Senft DepositPerformed AccountId: 501 Amount: 20€ OwnerChanged AccountId: 501 NewOwner: Simon Oberthür WithdrawalPerformed AccountId: 501 Amount: 10€ BankAccount Id: 501 Owner: Björn Senft Balance: 0€ BankAccount Id: 501 Owner: Björn Senft Balance: 20€ BankAccount Id: 501 Owner: Simon Oberthür Balance: 20€ BankAccount Id: 501 Owner: Simon Oberthür Balance: 10€ BankAccount Empty apply to apply to apply to apply to produces produces produces produces Deleting? Retroactive Event! An event undoing something that happened in the past. BankAccountClosed reason 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft37
  • 32. Pros and Cons General Advantages • High Scalability • Transparency as every change is recorded • Deterministic error search General Disadvantages • High software development effort • “Packaging up every change to an application as an event is an interface style that not everyone is comfortable with, and many find to be awkward” ? • „Querying on a lot of events“ 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft39
  • 34. CQRS Service Interfaces Read Side Write Side Event Store Publishes Events after they have been saved Denormalized Read Store Subscribes to Events on the Write Side Query Append events Events Query response User views data in the UI User makes a change in the UI Command 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft41
  • 35. Pros and Cons General Advantages • High Scalability • Optimal for SOA / Cloud Computing • Read and Write access can scale indepently • Split up development for teams General Disadvantages • High software development effort • Needs a fitting infrastructure • Transactions are challenging • You can query before a command was executed (Eventual Consistency) 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft42
  • 36. ES+CQRS in practice Example: HiP-App „Microservices“ Parallel Models CMS CMS AngularApp DataStore CMS Web API 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft43
  • 38. ES + CQRS for experiments Different versions at runtime • Bounded contexts • Parallel models • Separation of read and write side Logging • ES stores every state change by default • User interactions can directly be logged into ES Microservices • Lower complexity • Easier change of requirements 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft45
  • 39. Experiments are not feasible! • Risk to change a running system is too high! • Huge effort to host several alternatives! • Experiments produce insights on which we can‘t react fast enough! • Our technology stack doesn‘t support your idea! • Running experiments cost too much (e. g. implementation, seperate logging, assign experiments to users)! • Experiments aren‘t mature and crash the whole system! • We can support only one version of the API at once! 16.01.2018 Event Sourcing und CQRS für Experimentieren - Björn Senft46