SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
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

Mais conteúdo relacionado

Semelhante a DevOps - Experimentieren aber wie? - Björn Senft

Denise Brown Sql Porfolio
Denise Brown Sql PorfolioDenise Brown Sql Porfolio
Denise Brown Sql Porfoliobibbab1
 
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 ArchitecturesAmazon Web Services
 
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...
برنامج موارد بشرية شامل و متكامل عربي و انجليزيى متوافق مع قانون العمل السعود...ERP - Eye Bright
 
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 FinancialsSAPinsider 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 EssentialsSenturus
 
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 platformRamon 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 VirtualizationDenodo
 
Quick Note Presentation
Quick Note PresentationQuick Note Presentation
Quick Note PresentationAideen Leacy
 
Webinar: Microsoft ignite 2020 Key Takeaways
Webinar: Microsoft ignite 2020  Key TakeawaysWebinar: Microsoft ignite 2020  Key Takeaways
Webinar: Microsoft ignite 2020 Key TakeawaysWithum
 
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 modelsJos 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 2020Association for Project Management
 
213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.key213 event processingtalk-deviewkorea.key
213 event processingtalk-deviewkorea.keyNAVER D2
 
Workday Integration Online Training.pdf
Workday Integration Online Training.pdfWorkday Integration Online Training.pdf
Workday Integration Online Training.pdfSpiritsoftsTraining
 
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 kibanaAllen 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 YouAnton Chuvakin
 

Semelhante a 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
 

Mais de 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 GraalVMMark 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 PaderbornMark Lechtermann
 
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.0Mark 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 DeployMark 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 PaderbornMark 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 PaderbornMark Lechtermann
 

Mais de 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
 

Último

Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolinonuriaiuzzolino1
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptxAsmae Rabhi
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsMonica Sydney
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsMonica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样ayvbos
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtrahman018755
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.krishnachandrapal52
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxgalaxypingy
 

Último (20)

Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx75539-Cyber Security Challenges PPT.pptx
75539-Cyber Security Challenges PPT.pptx
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
PowerDirector Explination Process...pptx
PowerDirector Explination Process...pptxPowerDirector Explination Process...pptx
PowerDirector Explination Process...pptx
 

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