This document provides an overview of common software complexity issues and techniques that may help address them. It discusses issues like platform coupling and model ambiguity. It then describes 9 levels of techniques to decouple systems in an iterative way, including using event-driven architectures with de-normalized models, event stores, projections, APIs, and task-based UIs. It emphasizes the importance of continuous improvement, separating concerns, and adapting approaches based on business needs rather than technical preferences.
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
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
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
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
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
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
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
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
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