SlideShare ist ein Scribd-Unternehmen logo
1 von 51
ABOUT ME
Developer @Adform – www.adform.com
https://lt.linkedin.com/in/raimondastijunaitis
WHAT THIS TALK IS NOT ABOUT
„Best Practices“
Deep dive into DDD, CQRS, Event Sourcing
Refactoring
WHAT IT IS ABOUT
Common (for some of us) software complexity
issues
Techniques that might help and were tried in
production
Continuous/Iterative decoupling
THE DUNGEON
ISSUES
Platform coupling
Model ambiguity
Growing learning curve
SCREW MUSHROOMS, GIVE ME GUNS
LEVEL 1 – DE-NORMALIZED MODELS
Specifically designed for quering
Built asynchronously
Messages dispatched from legacy code
SALVATION WITH EVENTS
Send Message
DE-NORMALIZED MODEL
Project
Ad
Deactivated
Ad
Updated
Ad
Created
OTHER POSSIBLE WAYS
SQL Server replications
Depends on consumer count and your system load
Replicates the same relational structure
SQL Server Message Broker
Queue based message publishing
Custom data messages
Re-use write-model + caching
Be careful with excessive indexing – this might harm your
writes
Cache rebuild and invalidation issues
READ MODELS
NEW WEAPON UNLOCKED
MEET NEW ENEMIES (FRIENDS?)
Eventual consistency
Consistency is a myth
Talk with your business people
Tradeoffs
Idempotency and ordering
Event versions
Read-model versions
What about 1 thread?
Desynchronization
Create sync tools
LEVEL 2 – SYNERGY BETWEEN SYSTEMS
Avoid adding new features into monolith
Avoid big-bang reworks
Use strategic design to handle complexity
REWORK != REFACTORING
Two systems side-by-
side works together
Iterative functionality
migration
In-syncOld
System
New
System
Sync
TIP: Sometimes it is
better to start over
TIP: Having backup
strategy keeps your
blood pressure low
TIP: Go live ASAP
SEPARATE INFRASTRUCTURE FROM
BUSINESS LOGIC
TIP: Identify
infrastructure code
and separate it
TIP: Use different
models for different
tasks
STRATEGIC DESIGN
NEW WEAPON UNLOCKED
LEVEL 3: WRITE MODEL DESIGN
Accepts commands
only
Does not provide
reading operations
Commands results into
sequence of events
Events are immutable
and persisted into
EventStore
Commands RabbitMQ
Banner
Management
Service
Event Store
Events
OR ANY OTHER ORM FRAMEWORK
Aggregates emit events
Aggregates are de-hydrated by replaying historical
events
No setters/getters
Respect encapsulation
NO HIBERNATE
TIP: Events and
commands can be very
natural constructs
TIP: Excluding query
operations can
simplify code a lot
COMMANDS AND EVENTS
NEW WEAPON UNLOCKED
LEVEL 4: EVENT STORE
Stores series of immutable events
There is no delete
Acts as “Event Log”
Has built in projection engine
Is not designed for querying
BannerCreated BannerClickUrlsAdded BannerRenamed BannerRenamed
EVENT SOURCING
NEW WEAPON UNLOCKED
Performs left-folding of
historical events
Produces
projections/views into
streams
Event selection
LEVEL 5: PROJECTIONS
Banner Projection
Click Urls
changed
Image
Renamed
Image
Created
Publishing UI Tags
PROJECTIONS
NEW WEAPON UNLOCKED
Two way synchronization
Anti-corruption layer patters
LEVEL 6: STAYING IN SYNC
SYNC: NEW TO OLD
Banner
Event
Event Store
Dispatcher
ACL Service
RabbitMQ
AdministrationDB
Reacts to domain
events
Makes changes into
AdsministrationDB
within small
transactions
Uses Dapper to
simplify persistence
SYNC: OLD TO NEW
Legacy event
ACL Service
RabbitMQ
Reacts to legacy
events
(AdCreated/AdUpd
ated)
ACL transforms
events into
commands
Aggregates are
updated
Banner
Management
Service
Commands From old
system
Events
TIP: Make legacy
integration
interactions explicit
ANTI-CORRUPTION LAYERS
NEW WEAPON UNLOCKED
LEVEL 7: API
This is the only way to interact with your system
Build UI on top of the API
Versioning is difficult – think if you really need it
EXPOSE COMMANDS AS RESOURCES
PUT: http://.../ImageBaner/{uuid}/Name
Command: RenameBanner
PUT: http://.../ImageBaner/{uuid}/File
Command: ReuploadFile
HYPERMEDIA – HELP YOUR CLIENT
GET: http://.../ImageBanner/{uuid}
HTTP API
NEW WEAPON UNLOCKED
LEVEL 8: UI & UX
Excel is already invented, it’s pretty damn good
UI must be built on top of your API
Guide user through business process
BEFORE
AFTER
TIP: Build UI to solve
business cases but
not to edit data
TIP: Exposing tasks
can reduce overhead
for users and for
developers
TIP: Build UI on top
of the API
TASK BASED UI
NEW WEAPON UNLOCKED
LEVEL 9: TROUBLESHOOTING AND
DEBUGGING
There is no F5 in distributed systems
Correlate all your requests and messages
Use centralized logging services
INSIDE THE RABBIT HOLE
REST
API
Domain
Service
ACL
Service
ES
Dispatcher
Service
Creative
Upload
API
Creative
Upload
Service
Ad
Analyzer
Service
File
Checker
Service
File
Generation
Service
Publishing
Service
Preview
Service
TRACK OPERATIONS
TIP: Track every
operation performance –
this helps to identify
bottlenecks
TIP: Automate load tests
and run them often.
CORRELATION IDS
NEW ITEM UNLOCKED: NIGHT VISION
YOU DON’T NEED THEM ALL - CHOOSE WISELY
De-normalized read models
Strategic design
CQRS
Event sourcing
Projections
ACLs
REST API
Task based UI
Centralized logs
LOTS OF GUNS
BUT WHAT IF…
No guns for
You!!!
ADAPT TO BUSINESS THINKING
Avoid – technical arguments
Code quality is poor
We need to refactor
Technology is old
Everyone is using Angular
now…
Missing “best practices”
We want to try NoSQL…
Prefer – economical arguments
Releases every day
Faster feature development
New products
Involve more developers
MS licenses are expensive…
DON’T GET LOST IN A DUNGEON
Have a VISION
COMMIT
Define Your STRATEGY
Create TACTICS
FIGHT
ADOPT new tactics
Fight HARDER
WIN
Raimondas tijunaitis tackle_big_ball_of_mud_super_mario_style

Weitere ähnliche Inhalte

Ähnlich wie Raimondas tijunaitis tackle_big_ball_of_mud_super_mario_style

Event Storming & Event Sourcing with Lagom
Event Storming & Event Sourcing with LagomEvent Storming & Event Sourcing with Lagom
Event Storming & Event Sourcing with LagomGernot Schulmeister
 
RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainLourens Naudé
 
arch_mtg_sqlsig_hcotter_replication.ppt
arch_mtg_sqlsig_hcotter_replication.pptarch_mtg_sqlsig_hcotter_replication.ppt
arch_mtg_sqlsig_hcotter_replication.pptssuser418eef
 
Advanced PowerShell Automation
Advanced PowerShell AutomationAdvanced PowerShell Automation
Advanced PowerShell Automationkieranjacobsen
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applicationspeychevi
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deploymentFilippo Zanella
 
Building A Scalable Architecture
Building A Scalable ArchitectureBuilding A Scalable Architecture
Building A Scalable Architecturebhavintu79
 
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)Red Hat Developers
 
10 commandments for writing spiffy Lightning Apps
10 commandments for writing spiffy Lightning Apps10 commandments for writing spiffy Lightning Apps
10 commandments for writing spiffy Lightning AppsAnup Jadhav
 
Managing Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudManaging Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudCloudBees
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightFrank La Vigne
 
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info SheetMark Proctor
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...Fwdays
 
Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Wes Yanaga
 
Architecting with a 'cloud first' mindset
Architecting  with a 'cloud first' mindsetArchitecting  with a 'cloud first' mindset
Architecting with a 'cloud first' mindsetMarc Mercuri
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureChris Patterson
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaMagnolia
 
ASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseDennis Moon
 

Ähnlich wie Raimondas tijunaitis tackle_big_ball_of_mud_super_mario_style (20)

Event Storming & Event Sourcing with Lagom
Event Storming & Event Sourcing with LagomEvent Storming & Event Sourcing with Lagom
Event Storming & Event Sourcing with Lagom
 
RailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your DomainRailswayCon 2010 - Command Your Domain
RailswayCon 2010 - Command Your Domain
 
arch_mtg_sqlsig_hcotter_replication.ppt
arch_mtg_sqlsig_hcotter_replication.pptarch_mtg_sqlsig_hcotter_replication.ppt
arch_mtg_sqlsig_hcotter_replication.ppt
 
Advanced PowerShell Automation
Advanced PowerShell AutomationAdvanced PowerShell Automation
Advanced PowerShell Automation
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applications
 
Product! - The road to production deployment
Product! - The road to production deploymentProduct! - The road to production deployment
Product! - The road to production deployment
 
Building A Scalable Architecture
Building A Scalable ArchitectureBuilding A Scalable Architecture
Building A Scalable Architecture
 
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
Write Powerful Javascript Modules To Make Your Apps DRY (Brian Leathem)
 
10 commandments for writing spiffy Lightning Apps
10 commandments for writing spiffy Lightning Apps10 commandments for writing spiffy Lightning Apps
10 commandments for writing spiffy Lightning Apps
 
Managing Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the CloudManaging Software from Development to Deployment in the Cloud
Managing Software from Development to Deployment in the Cloud
 
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with SilverlightRe-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
Re-use Your Skills and Code to Expand the Reach of Your Apps with Silverlight
 
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the CloudWSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
WSO2Con US 2013 - Keynote: Developing Enterprise Apps In the Cloud
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
 
Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1Windows Phone 7 Unleashed Session 1
Windows Phone 7 Unleashed Session 1
 
Architecting with a 'cloud first' mindset
Architecting  with a 'cloud first' mindsetArchitecting  with a 'cloud first' mindset
Architecting with a 'cloud first' mindset
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Cto cloud
Cto cloudCto cloud
Cto cloud
 
Highly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and MagnoliaHighly Scalable User Experience Design: Vaadin and Magnolia
Highly Scalable User Experience Design: Vaadin and Magnolia
 
ASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile EnterpriseASP.NET Core For The Agile Enterprise
ASP.NET Core For The Agile Enterprise
 

Mehr von .NET Crowd

Clean architecture
Clean architectureClean architecture
Clean architecture.NET Crowd
 
Quantum Computing With the Q# Language
Quantum Computing With the Q# LanguageQuantum Computing With the Q# Language
Quantum Computing With the Q# Language.NET Crowd
 
Fast IDentity Online New wave of open authentication standards
Fast IDentity Online New wave of open authentication standardsFast IDentity Online New wave of open authentication standards
Fast IDentity Online New wave of open authentication standards.NET Crowd
 
Multi-threading your way out
Multi-threading your way outMulti-threading your way out
Multi-threading your way out.NET Crowd
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp).NET Crowd
 
Typescript language
Typescript languageTypescript language
Typescript language.NET Crowd
 
Dependency Injection: išmoktos pamokos
Dependency Injection: išmoktos pamokosDependency Injection: išmoktos pamokos
Dependency Injection: išmoktos pamokos.NET Crowd
 
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer....NET Crowd
 
Rokas Balevičius "Logstash - system heartbeat implementation"
Rokas Balevičius "Logstash - system heartbeat implementation"Rokas Balevičius "Logstash - system heartbeat implementation"
Rokas Balevičius "Logstash - system heartbeat implementation".NET Crowd
 
Andrej Slivko "CQRS praktikoje"
Andrej Slivko "CQRS praktikoje"Andrej Slivko "CQRS praktikoje"
Andrej Slivko "CQRS praktikoje".NET Crowd
 
Donatas Mačiūnas "Git - pažabokim istoriją"
Donatas Mačiūnas "Git - pažabokim istoriją"Donatas Mačiūnas "Git - pažabokim istoriją"
Donatas Mačiūnas "Git - pažabokim istoriją".NET Crowd
 

Mehr von .NET Crowd (11)

Clean architecture
Clean architectureClean architecture
Clean architecture
 
Quantum Computing With the Q# Language
Quantum Computing With the Q# LanguageQuantum Computing With the Q# Language
Quantum Computing With the Q# Language
 
Fast IDentity Online New wave of open authentication standards
Fast IDentity Online New wave of open authentication standardsFast IDentity Online New wave of open authentication standards
Fast IDentity Online New wave of open authentication standards
 
Multi-threading your way out
Multi-threading your way outMulti-threading your way out
Multi-threading your way out
 
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
Visual Studio Team Services Extensions by Taavi Kõosaar (@melborp)
 
Typescript language
Typescript languageTypescript language
Typescript language
 
Dependency Injection: išmoktos pamokos
Dependency Injection: išmoktos pamokosDependency Injection: išmoktos pamokos
Dependency Injection: išmoktos pamokos
 
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...
Tomas Urbonaitis "Introduction to asynchronous persistent messaging with NSer...
 
Rokas Balevičius "Logstash - system heartbeat implementation"
Rokas Balevičius "Logstash - system heartbeat implementation"Rokas Balevičius "Logstash - system heartbeat implementation"
Rokas Balevičius "Logstash - system heartbeat implementation"
 
Andrej Slivko "CQRS praktikoje"
Andrej Slivko "CQRS praktikoje"Andrej Slivko "CQRS praktikoje"
Andrej Slivko "CQRS praktikoje"
 
Donatas Mačiūnas "Git - pažabokim istoriją"
Donatas Mačiūnas "Git - pažabokim istoriją"Donatas Mačiūnas "Git - pažabokim istoriją"
Donatas Mačiūnas "Git - pažabokim istoriją"
 

Kürzlich hochgeladen

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 

Kürzlich hochgeladen (20)

DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

Raimondas tijunaitis tackle_big_ball_of_mud_super_mario_style

  • 1.
  • 2. ABOUT ME Developer @Adform – www.adform.com https://lt.linkedin.com/in/raimondastijunaitis
  • 3. WHAT THIS TALK IS NOT ABOUT „Best Practices“ Deep dive into DDD, CQRS, Event Sourcing Refactoring
  • 4. WHAT IT IS ABOUT Common (for some of us) software complexity issues Techniques that might help and were tried in production Continuous/Iterative decoupling
  • 8. LEVEL 1 – DE-NORMALIZED MODELS Specifically designed for quering Built asynchronously Messages dispatched from legacy code
  • 11. OTHER POSSIBLE WAYS SQL Server replications Depends on consumer count and your system load Replicates the same relational structure SQL Server Message Broker Queue based message publishing Custom data messages Re-use write-model + caching Be careful with excessive indexing – this might harm your writes Cache rebuild and invalidation issues
  • 13. MEET NEW ENEMIES (FRIENDS?) Eventual consistency Consistency is a myth Talk with your business people Tradeoffs Idempotency and ordering Event versions Read-model versions What about 1 thread? Desynchronization Create sync tools
  • 14. LEVEL 2 – SYNERGY BETWEEN SYSTEMS Avoid adding new features into monolith Avoid big-bang reworks Use strategic design to handle complexity
  • 15. REWORK != REFACTORING Two systems side-by- side works together Iterative functionality migration In-syncOld System New System Sync
  • 16. TIP: Sometimes it is better to start over TIP: Having backup strategy keeps your blood pressure low TIP: Go live ASAP
  • 18. TIP: Identify infrastructure code and separate it TIP: Use different models for different tasks
  • 20. LEVEL 3: WRITE MODEL DESIGN Accepts commands only Does not provide reading operations Commands results into sequence of events Events are immutable and persisted into EventStore Commands RabbitMQ Banner Management Service Event Store Events
  • 21. OR ANY OTHER ORM FRAMEWORK Aggregates emit events Aggregates are de-hydrated by replaying historical events No setters/getters Respect encapsulation NO HIBERNATE
  • 22. TIP: Events and commands can be very natural constructs TIP: Excluding query operations can simplify code a lot
  • 23. COMMANDS AND EVENTS NEW WEAPON UNLOCKED
  • 24. LEVEL 4: EVENT STORE Stores series of immutable events There is no delete Acts as “Event Log” Has built in projection engine Is not designed for querying BannerCreated BannerClickUrlsAdded BannerRenamed BannerRenamed
  • 26. Performs left-folding of historical events Produces projections/views into streams Event selection LEVEL 5: PROJECTIONS Banner Projection Click Urls changed Image Renamed Image Created Publishing UI Tags
  • 28. Two way synchronization Anti-corruption layer patters LEVEL 6: STAYING IN SYNC
  • 29. SYNC: NEW TO OLD Banner Event Event Store Dispatcher ACL Service RabbitMQ AdministrationDB Reacts to domain events Makes changes into AdsministrationDB within small transactions Uses Dapper to simplify persistence
  • 30. SYNC: OLD TO NEW Legacy event ACL Service RabbitMQ Reacts to legacy events (AdCreated/AdUpd ated) ACL transforms events into commands Aggregates are updated Banner Management Service Commands From old system Events
  • 33. LEVEL 7: API This is the only way to interact with your system Build UI on top of the API Versioning is difficult – think if you really need it
  • 34. EXPOSE COMMANDS AS RESOURCES PUT: http://.../ImageBaner/{uuid}/Name Command: RenameBanner PUT: http://.../ImageBaner/{uuid}/File Command: ReuploadFile
  • 35. HYPERMEDIA – HELP YOUR CLIENT GET: http://.../ImageBanner/{uuid}
  • 37. LEVEL 8: UI & UX Excel is already invented, it’s pretty damn good UI must be built on top of your API Guide user through business process
  • 39. AFTER
  • 40. TIP: Build UI to solve business cases but not to edit data TIP: Exposing tasks can reduce overhead for users and for developers TIP: Build UI on top of the API
  • 41. TASK BASED UI NEW WEAPON UNLOCKED
  • 42. LEVEL 9: TROUBLESHOOTING AND DEBUGGING There is no F5 in distributed systems Correlate all your requests and messages Use centralized logging services
  • 43. INSIDE THE RABBIT HOLE REST API Domain Service ACL Service ES Dispatcher Service Creative Upload API Creative Upload Service Ad Analyzer Service File Checker Service File Generation Service Publishing Service Preview Service
  • 45. TIP: Track every operation performance – this helps to identify bottlenecks TIP: Automate load tests and run them often.
  • 46. CORRELATION IDS NEW ITEM UNLOCKED: NIGHT VISION
  • 47. YOU DON’T NEED THEM ALL - CHOOSE WISELY De-normalized read models Strategic design CQRS Event sourcing Projections ACLs REST API Task based UI Centralized logs LOTS OF GUNS
  • 48. BUT WHAT IF… No guns for You!!!
  • 49. ADAPT TO BUSINESS THINKING Avoid – technical arguments Code quality is poor We need to refactor Technology is old Everyone is using Angular now… Missing “best practices” We want to try NoSQL… Prefer – economical arguments Releases every day Faster feature development New products Involve more developers MS licenses are expensive…
  • 50. DON’T GET LOST IN A DUNGEON Have a VISION COMMIT Define Your STRATEGY Create TACTICS FIGHT ADOPT new tactics Fight HARDER WIN