SlideShare a Scribd company logo
1 of 72
Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
@ddoomen
Hybrid of
Technologies
Multiple patterns
for the same problems
Long compile
time
Large source control
repositories
Long-running
unit tests
Too much
coupling
Limited
team scalability
Devs need to
know everything
NoIsolation.Productivity
drops over time.
Proof of success!
Application
Functional Module Functional Module Functional Module Functional Module
Composition
Each module
owns/exposes its
master data
Does not
depend on
anything
except for
curated
shared APIs
Owns
schema and
storage
(may use
shared
database
abstraction)
DRY within
module, not
outside
May use an
internal
container
Does not
touch other
module’s
data directly
Shared Services
Connects the
modules and
serves as anti-
corruption layer
Only services you
really think should
not be duplicated
Designed according to
Dependency Inversion Principle
Covers
front-end
and back-
end
is the scope
of unit &
integration
tests
Align folder
structure
with
boundaries
Defines the
contracts
for the host
as well as
any services
it exposes
Aligned with
Bounded
Context.
What is a
microservice?
From https://martinfowler.com/articles/microservices.html
Very scalable, very
reliable
Very difficult to
debug distributed
problems
Unreliable network
requires resiliency
techniques
Requires message
bus/broker/
gateway
End-to-end testing
very unpractical
Very mature
DevOps culture is a
prerequisite
Advanced monitoring
and visualization is a
must
High operational
maintenance
Can be deployed/upgraded
independently
Explosion of
network activity.
The First Law of
Distributed
Computing
Monolith
Functional Module
Functional Module
Functional Module
HTTP API
HTTP API
HTTP API
Released as NuGet packageNo network I/O at all
Own database instance, / shared with
monolith / or shared storage service
Owns the schema
Separate repos with
distinct owners
Runs in-process, thus
easier debugging
New version
requires
redeployment of
the monolith.
Loose coupling through
HTTP
Less scalability
options
HTTP is not the
fastest serialization
format
Designed for minimum
dependencies
Client
IIS
Console
WinSvc
Unit Test
HTTP
request
HTTP
response
Middleware
environment
handler
next
Middleware
IDictionary<string, object>
Func<IDictionary<string, object>, Task>
Task
Func<
Func<IDictionary<string, object>, Task>,
Func<IDictionary<string, object>, Task>
>
Func<IDictionary<string, object>, Task>
Client
IIS
Console
WinSvc
Unit Test
HTTP
request
HTTP
response
Middleware
context
handler
next
Middleware
HttpContext
Task
Func<
HttpContext, Func<Task>, Task
>
Func<HttpContext, Task>
Func<HttpContext, Task>
Monolith
Functional Module
HTTP API
Module Registry
Contract documented
through OpenAPI
Webhook
Functional Module
Functional Module
Provides HTTP
abstraction to connect to
module
Event payload exposed as
OpenAPI
Subscribers register
HTTP abstraction
Consumers use liberal
JSON interpretation
Subcribers can request
resending history.
Payload includes unique
ID to help idempotency
Each request requires correlation
ID that flows through all APIs,
webhooks and module
Dennis Doomen | @ddoomen | The Continuous Improver
Application
Domain
NoSQL / RDBMS
OR/M / DAL
Web UI, HTTP API,
etc
Lucene Index
Document Projector
Web UI, HTTP
API, etc
Web UI, HTTP API, etc
Domain
Commands
Events
Event StoreProjections
Projectors
Uses Event
Sourcing
Uses
traditional
CRUD
architecture
Indexing-based
architecture
Subcribe
to webhooks
Coarse-
grained
HTTP
requests.
Bus
Subscribe
Publish coarse-
grained event
Domain is persistency
ignorant
For modules that provide
a (partial) UI or
management screen
Aggregates
Command
Handlers
Commands
Events
Upconverters
Value Objects
Query
Handlers
Schema
Migrations
Projectors
Data
Importers
Query API
Projections
HTML
CSS JS
API
Controllers
Projectors
Projections
Registrations
Webhook API
Command
API
Event
Storage
Domain
Services
Payload
Definitions
Can be tested
independently
Based on Domain Driven
Design
Outer layers depend on
inner layers
Master data
Application
Command
Service
Correct
Customer
Email Handler
Customer
Unit of
Work
Projector
Data
Access
Layer
Read
Database Write
Database
CorrectCustomerEmailCommand
HTTP API / In-process invocation
Get<Customer>(identity)
Correct Email
Event Store
Load(events)
Apply
Get changes
CustomerEmailCorrectedEvent
Submit changes
History
Dennis Doomen | @ddoomen | The Continuous Improver
NES
Aggregates.NET
SimpleDomain
NStore
EventStore
NEventStore
SQLStreamStore
NStore
NES
Marten
Handelier
Brighter
MediatR (*)
Projac
LiquidProjections (*)
Monolith
Functional Module
HTTP API
Event Store
Events
Payload
Projector
Subscription
Request
Payload
‘event store’
Have their own
checkpoints
Projects fine-grained
events into payload
projections
Projector
Projector
Projector
Webhook Projectors
Separate instance
per subscription
Subscriber
Callback API
‘Project’ payload
‘events’ into HTTP
calls
Projected Data
Uses the incoming
payloads as an
‘event store’.
Payload
SQL DB Schema
changes using code
or using NoSQL
Subscription
Request
- Module owns ‘schema’
- Supports upgrading and downgrading
- NoSQL preferred, but RDBMS can
work too.
Event Store
Projector
Application
Version 2
Owns schema
(e.g. FluentMigrator)
Version 1
X
Involves down-time until
projections are rebuild
Dennis Doomen | @ddoomen | The Continuous Improver
Event Store
Projector
Application Application
Network Load Balancer
Event Store
Version 1 Version 2
events
Projection ProjectorProjection
bring off-line
Returns HTTP 503
(Service Unavailable)
Dennis Doomen | @ddoomen | The Continuous Improver
Returns HTTP 503
(Service Unavailable)
Dennis Doomen | @ddoomen | The Continuous Improver
var mapBuilder = new EventMapBuilder<MyContext, DocumentProjection, string>();
mapBuilder
.Map<WarrantAssignedEvent>()
.AsCreateOf(anEvent => anEvent.Number)
.Using((document, anEvent) =>
{
document.Type = "Warrant";
document.Kind = anEvent.Kind;
document.Country = anEvent.Country;
document.State = anEvent.InitialState;
});
mapBuilder
.Map<StateTransitionedEvent>()
.When(anEvent => anEvent.State != "Closed")
.AsUpdateOf(anEvent => anEvent.DocumentNumber)
.Using((document, anEvent) => document.State = anEvent.State);
Dennis Doomen | @ddoomen | The Continuous Improver
var stats = new ProjectionStats(() => DateTime.UtcNow);
stats.StoreProperty("CountByDocument", "some setting key", "some value");
stats.LogEvent("CountByDocument", "some significant thing that happened");
stats.TrackProgress("CountByDocument", currentCheckpoint);
float? transactionsPerSecond = stats.GetSpeed("CountByDocument");
TimeSpan? eta = stats.GetTimeToReach("CountByDocument", targetCheckpoint);
public void Configure(IAppBuilder builder)
{
builder.UseStatistics(stats);
}
Dennis Doomen | @ddoomen | The Continuous Improver
IAppBuilder builder = ….
builder.UseStatistics(stats);
GET http://localhost/projectionStats/CountByDocument
{
"projectorId": "CountByDocument",
"lastCheckpoint": 1000,
"lastCheckpointUpdatedUtc": "2018-05-10T10:39:00Z",
"properties": [{
"key": "some setting key",
"value": "some value",
"lastUpdatedUtc": "2018-05-10T10:39:00Z"
}],
"eventsUrl": "http://localhost/projectionStats/CountByDocument/events"
}
Dennis Doomen | @ddoomen | The Continuous Improver
Service Host
Monolith
Functional Module
Functional Module
Functional Module
HTTP API
HTTP API
HTTP API
Apply routing
conventions
Versioning
using Accept Headers,
Response Headers or
Routes
Optimize body using
AVRO or Protobuf
Cross-service tracing
using OpenTracing
Replace HTTP with gRPC
Common contracts for
diagnostics, monitoring
HTTP Proxy
Child process
of monolith (e.g.
LitteForker)
Hides the externalized
state of the module (e.g.
ProxyKit)
1 Build a (container-based) cloud
capability.
2 Deploy monolith to the cloud.
3 Automate your delivery pipeline.
4 Full end-to-end responsibility
5 Evaluate status-quo on micro-services
(products, platforms, etc)
6 Slide-and-dice microservices one-by-
one
7 Break-up delivery teams and code.
Dennis Doomen
@ddoomen
Dennis Doomen | @ddoomen | The Continuous Improver
• Liquid Projections
https://www.liquidprojections.net
• Bliki: MonolithFirst
https://dzone.com/articles/martin-fowler%E2%80%94bliki
• In-process gRPC
https://github.com/grpc/grpc-go/issues/906
• Ingredients for well-designed OWIN components
https://www.continuousimprover.com/search/label/OWIN%20
Recipes
• The good, the bad and the ugly of Event Sourcing
https://www.continuousimprover.com/search/label/event%20s
ourcing
• Aggregates.NET
https://github.com/volak/Aggregates.NET
• EventFlow
https://github.com/eventflow/EventFlow
• OWIN in ASP.NET Core
https://docs.microsoft.com/en-
us/aspnet/core/fundamentals/owin?view=aspnetcore-2.1
• Nested ASP.NET Core applications
http://dhickey.ie/2018/06/09/aspnet-core-nested-apps/
• LittleForker
https://github.com/damianh/LittleForker
• ProxyKit
https://github.com/ProxyKit/ProxyKit
Domain
Event Store
Events
App
RDBMS
Events
Projection
EventsProjection
Projection
Projector
Optimized for
specific queries
Separate
projections
database NoSQL
Projector
Projection-specific
storage
Projector
HTML
Raw SQL or
Dapper
Run
asynchronously
Great for
sharding
Dennis Doomen | @ddoomen | The Continuous Improver
Events
Transaction 6
Transaction 5
Transaction 4
Transaction 3
Transaction 2
Transaction 1
Temporal
Projector
Read
Store
Time
Projected until
this point
Immutable, thus
auditable and SOX
compliance
Dennis Doomen | @ddoomen | The Continuous Improver
Domain
Event Store
Events
App
Events
Projection
EventsProjection
Projection
Projector
Application
projections
RDBMS
Reporting
Projector
Traditional
reporting model
Asynchronous
OLAP
Dennis Doomen | @ddoomen | The Continuous Improver
Dennis (v4)
Persisted State Changes
Dennis (v3)
Role Granted
PasswordChangedEvent
Dennis (v4)
Dennis (v3)
User Created
Role Granted
Phone Number Added
Password Changed
Dennis (v5)
Role Revoked
Dennis (v6)
Role Granted
Time
Dennis (v7)
Password Changed
Dennis Doomen | @ddoomen | The Continuous Improver
Events
1
2
3
6297
6298
6298
Projections
Documents
Groups
Users
Objects
Folders
Microservice
V2
Changes Queries
Events
1
2
3
6299
6300
6301
Projections
Documents
Groups
Users
Objects
Folders
Microservice
V1
ChangesQueries
Migration Process
Dennis Doomen | @ddoomen | The Continuous
Improver
Events
Aggregate
Root
Entity
Entity
Value
Object
Aggregate
Root
Aggregate
Root
Aggregate
Root
Entity
Value
Object
Value
Object
Dennis Doomen | @ddoomen | The Continuous Improver
Designing your domain
based on ownership
Relying on eventual
consistent projections
Bad choice in
functional keys (e.g.
username vs ID)
Running business logic
after an domain event
is raised
Domain-specific value
types in events
Ask questions about
consistency
Understand the real world
Driven by invariants, not
composition
Only consistent within
aggregate
Small aggregates
Reference by identity
• Column constraints (e.g. data truncation)
• Changes in data invariants (null vs non-
null in event versions)
• Unexpected projection dependencies
• Partial replays.
• Causing duplicate child records
• Causing large event streams
• Incorrect caching strategy (e.g. on
lookups)
• Identity case-sensitivity
• Incomplete SQL-backed event store
reads.
• Side by side rebuilding
• Functional archivability and archiving
• Projection tracking and ETAs
• Prioritization
• Partitioning.
• After bugs, schema changes, etc
• Manual or automatic (e.g. hashes)
Microservice
Bunch of classes that
should be used directly
X
No inheritance
Uses composition
over inheritance
internally
Convenience classes
that don’t hide the
magic
Library
Abstract Package
Interfaces
Delegates
DTOs
Only depend
on abstract
packages…
Stable Package
…or depend on more
stable packages
Auxiliary
Package
Classes that are not
used together do not
belong togetherOptional
Dependency
Dependency
Package
Consumers should
not be faced with
optional
dependencies
public interface IEventStore
{
IDisposable Subscribe(
long? lastCheckpoint,
Func<Transaction[]>, Task> handler,
string subscriptionId);
}
public delegate IDisposable CreateSubscription(
long? lastCheckpoint,
Func<Transaction[]>, Task> handler,
string subscriptionId);
e.g. LibLog, TinyIoc, FluidCaching
• The network is reliable
• Latency is zero
• Bandwidth is infinite
• The network is secure
• Topology doesn't change
• There is one administrator
• Transport cost is zero
• The network is homogeneous.
https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing

More Related Content

What's hot

Event Driven Architecture (Integration Tech Event 2019)
Event Driven Architecture (Integration Tech Event 2019)Event Driven Architecture (Integration Tech Event 2019)
Event Driven Architecture (Integration Tech Event 2019)Jeppe Cramon
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven ArchitectureChris Patterson
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software PerformanceGibraltar Software
 
Decoupling with Domain Events
Decoupling with Domain EventsDecoupling with Domain Events
Decoupling with Domain EventsSteven Smith
 
Greenfield Development with CQRS
Greenfield Development with CQRSGreenfield Development with CQRS
Greenfield Development with CQRSDavid Hoerster
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDDennis Doomen
 
Event Sourcing - Greg Young
Event Sourcing - Greg YoungEvent Sourcing - Greg Young
Event Sourcing - Greg YoungJAXLondon2014
 
Patterns of enterprise application architecture
Patterns of enterprise application architecturePatterns of enterprise application architecture
Patterns of enterprise application architectureChinh Ngo Nguyen
 
Dropping ACID - Building Scalable Systems That Work
Dropping ACID - Building Scalable Systems That WorkDropping ACID - Building Scalable Systems That Work
Dropping ACID - Building Scalable Systems That WorkChris Patterson
 
CQRS and what it means for your architecture
CQRS and what it means for your architectureCQRS and what it means for your architecture
CQRS and what it means for your architectureRichard Banks
 
Alternative microservices - one size doesn't fit all
Alternative microservices - one size doesn't fit allAlternative microservices - one size doesn't fit all
Alternative microservices - one size doesn't fit allJeppe Cramon
 
Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8J On The Beach
 
Amazon AWS - a quick review
Amazon AWS - a quick reviewAmazon AWS - a quick review
Amazon AWS - a quick reviewGeeks Anonymes
 
Reactive Development: Commands, Actors and Events. Oh My!!
Reactive Development: Commands, Actors and Events.  Oh My!!Reactive Development: Commands, Actors and Events.  Oh My!!
Reactive Development: Commands, Actors and Events. Oh My!!David Hoerster
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRSthinkddd
 
Seminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSSeminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSMizanur Sarker
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkbanq jdon
 
DDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learnedDDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learnedQframe
 

What's hot (20)

Event Driven Architecture (Integration Tech Event 2019)
Event Driven Architecture (Integration Tech Event 2019)Event Driven Architecture (Integration Tech Event 2019)
Event Driven Architecture (Integration Tech Event 2019)
 
Event Driven Architecture
Event Driven ArchitectureEvent Driven Architecture
Event Driven Architecture
 
Natural Laws of Software Performance
Natural Laws of Software PerformanceNatural Laws of Software Performance
Natural Laws of Software Performance
 
Decoupling with Domain Events
Decoupling with Domain EventsDecoupling with Domain Events
Decoupling with Domain Events
 
Event sourcing
Event sourcingEvent sourcing
Event sourcing
 
Greenfield Development with CQRS
Greenfield Development with CQRSGreenfield Development with CQRS
Greenfield Development with CQRS
 
CQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDDCQRS and Event Sourcing, An Alternative Architecture for DDD
CQRS and Event Sourcing, An Alternative Architecture for DDD
 
Event Sourcing - Greg Young
Event Sourcing - Greg YoungEvent Sourcing - Greg Young
Event Sourcing - Greg Young
 
Patterns of enterprise application architecture
Patterns of enterprise application architecturePatterns of enterprise application architecture
Patterns of enterprise application architecture
 
Dropping ACID - Building Scalable Systems That Work
Dropping ACID - Building Scalable Systems That WorkDropping ACID - Building Scalable Systems That Work
Dropping ACID - Building Scalable Systems That Work
 
Domain Event - The Hidden Gem of DDD
Domain Event - The Hidden Gem of DDDDomain Event - The Hidden Gem of DDD
Domain Event - The Hidden Gem of DDD
 
CQRS and what it means for your architecture
CQRS and what it means for your architectureCQRS and what it means for your architecture
CQRS and what it means for your architecture
 
Alternative microservices - one size doesn't fit all
Alternative microservices - one size doesn't fit allAlternative microservices - one size doesn't fit all
Alternative microservices - one size doesn't fit all
 
Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8Event Sourcing in less than 20 minutes - With Akka and Java 8
Event Sourcing in less than 20 minutes - With Akka and Java 8
 
Amazon AWS - a quick review
Amazon AWS - a quick reviewAmazon AWS - a quick review
Amazon AWS - a quick review
 
Reactive Development: Commands, Actors and Events. Oh My!!
Reactive Development: Commands, Actors and Events.  Oh My!!Reactive Development: Commands, Actors and Events.  Oh My!!
Reactive Development: Commands, Actors and Events. Oh My!!
 
Stuff About CQRS
Stuff About CQRSStuff About CQRS
Stuff About CQRS
 
Seminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRSSeminar - Scalable Enterprise Application Development Using DDD and CQRS
Seminar - Scalable Enterprise Application Development Using DDD and CQRS
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
DDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learnedDDD, CQRS, ES lessons learned
DDD, CQRS, ES lessons learned
 

Similar to Decomposing the Monolith using modern-day .NET and a touch of microservices

Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azureSergey Seletsky
 
Big Data - in the cloud or rather on-premises?
Big Data - in the cloud or rather on-premises?Big Data - in the cloud or rather on-premises?
Big Data - in the cloud or rather on-premises?Guido Schmutz
 
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...IT Arena
 
Understanding the Windows Azure Platform - Dec 2010
Understanding the Windows Azure Platform - Dec 2010Understanding the Windows Azure Platform - Dec 2010
Understanding the Windows Azure Platform - Dec 2010DavidGristwood
 
Faites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchFaites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchMongoDB
 
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applications
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid ApplicationsA Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applications
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applicationsajithranabahu
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsJack-Junjie Cai
 
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...Dr. Tim Dörnemann
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patternsakqaanoraks
 
Crafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoCrafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoJAXLondon2014
 
Wisconsin .NET UG - Windows Azure
Wisconsin .NET UG - Windows AzureWisconsin .NET UG - Windows Azure
Wisconsin .NET UG - Windows AzureWade Wegner
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationMark Gu
 
Giga Spaces Data Grid / Data Caching Overview
Giga Spaces Data Grid / Data Caching OverviewGiga Spaces Data Grid / Data Caching Overview
Giga Spaces Data Grid / Data Caching Overviewjimliddle
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfoliocummings49
 
Big Data: It’s all about the Use Cases
Big Data: It’s all about the Use CasesBig Data: It’s all about the Use Cases
Big Data: It’s all about the Use CasesJames Serra
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Emerson Eduardo Rodrigues Von Staffen
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...Amazon Web Services
 
SharePoint 2010 Global Deployment
SharePoint 2010 Global DeploymentSharePoint 2010 Global Deployment
SharePoint 2010 Global DeploymentJoel Oleson
 

Similar to Decomposing the Monolith using modern-day .NET and a touch of microservices (20)

Cqrs and event sourcing in azure
Cqrs and event sourcing in azureCqrs and event sourcing in azure
Cqrs and event sourcing in azure
 
Big Data - in the cloud or rather on-premises?
Big Data - in the cloud or rather on-premises?Big Data - in the cloud or rather on-premises?
Big Data - in the cloud or rather on-premises?
 
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
Dennis Doomen. Using OWIN, Webhooks, Event Sourcing and the Onion Architectur...
 
Understanding the Windows Azure Platform - Dec 2010
Understanding the Windows Azure Platform - Dec 2010Understanding the Windows Azure Platform - Dec 2010
Understanding the Windows Azure Platform - Dec 2010
 
Faites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB StitchFaites évoluer votre accès aux données avec MongoDB Stitch
Faites évoluer votre accès aux données avec MongoDB Stitch
 
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applications
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid ApplicationsA Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applications
A Domain Specific Language for Enterprise Grade Cloud-Mobile Hybrid Applications
 
Easy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applicationsEasy integration of Bluemix services with your applications
Easy integration of Bluemix services with your applications
 
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
Composition and Execution of Secure Workflows in WSRF-Grids, IEEE CCGrid 2008...
 
RavenDB overview
RavenDB overviewRavenDB overview
RavenDB overview
 
James Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 PatternsJames Turner (Caplin) - Enterprise HTML5 Patterns
James Turner (Caplin) - Enterprise HTML5 Patterns
 
Crafted Design - Sandro Mancuso
Crafted Design - Sandro MancusoCrafted Design - Sandro Mancuso
Crafted Design - Sandro Mancuso
 
Wisconsin .NET UG - Windows Azure
Wisconsin .NET UG - Windows AzureWisconsin .NET UG - Windows Azure
Wisconsin .NET UG - Windows Azure
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
Giga Spaces Data Grid / Data Caching Overview
Giga Spaces Data Grid / Data Caching OverviewGiga Spaces Data Grid / Data Caching Overview
Giga Spaces Data Grid / Data Caching Overview
 
C# .NET Developer Portfolio
C# .NET Developer PortfolioC# .NET Developer Portfolio
C# .NET Developer Portfolio
 
Big Data: It’s all about the Use Cases
Big Data: It’s all about the Use CasesBig Data: It’s all about the Use Cases
Big Data: It’s all about the Use Cases
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
 
SharePoint 2010 Global Deployment
SharePoint 2010 Global DeploymentSharePoint 2010 Global Deployment
SharePoint 2010 Global Deployment
 

More from Dennis Doomen

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Dennis Doomen
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeDennis Doomen
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsDennis Doomen
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependenciesDennis Doomen
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)Dennis Doomen
 
Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDennis Doomen
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Dennis Doomen
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)Dennis Doomen
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Dennis Doomen
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptxDennis Doomen
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?Dennis Doomen
 
A lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeDennis Doomen
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footDennis Doomen
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)Dennis Doomen
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentDennis Doomen
 
How To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootHow To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootDennis Doomen
 
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Dennis Doomen
 
Strengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionStrengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionDennis Doomen
 
Build Libraries That People Love To use
Build Libraries That People Love To useBuild Libraries That People Love To use
Build Libraries That People Love To useDennis Doomen
 
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDecomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDennis Doomen
 

More from Dennis Doomen (20)

Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)Getting a grip on your code dependencies (2023-10)
Getting a grip on your code dependencies (2023-10)
 
Tools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy codeTools and practices to help you deal with legacy code
Tools and practices to help you deal with legacy code
 
What you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloadsWhat you can learn from an open-source project with 250 million downloads
What you can learn from an open-source project with 250 million downloads
 
Getting a grip on your code dependencies
Getting a grip on your code dependenciesGetting a grip on your code dependencies
Getting a grip on your code dependencies
 
My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)My Laws of Test Driven Development (2023)
My Laws of Test Driven Development (2023)
 
Design patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NETDesign patterns for Event Sourcing in .NET
Design patterns for Event Sourcing in .NET
 
Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#Automate Infrastructure with Pulumi and C#
Automate Infrastructure with Pulumi and C#
 
What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)What is the right unit in unit testing (UpdateConf 2022)
What is the right unit in unit testing (UpdateConf 2022)
 
Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!Slow Event Sourcing (re)projections - Just make them faster!
Slow Event Sourcing (re)projections - Just make them faster!
 
50 things software teams should not do.pptx
50 things software teams should not do.pptx50 things software teams should not do.pptx
50 things software teams should not do.pptx
 
What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?What is the right "unit" in unit testing and why it is not a class?
What is the right "unit" in unit testing and why it is not a class?
 
A lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable codeA lab around the principles and practices for writing maintainable code
A lab around the principles and practices for writing maintainable code
 
How to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the footHow to practice TDD without shooting yourself in the foot
How to practice TDD without shooting yourself in the foot
 
A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)A lab around the principles and practices for writing maintainable code (2019)
A lab around the principles and practices for writing maintainable code (2019)
 
Lessons learned from two decades of professional software development
Lessons learned from two decades of professional software developmentLessons learned from two decades of professional software development
Lessons learned from two decades of professional software development
 
How To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The FootHow To Practice TDD Without Shooting Yourself In The Foot
How To Practice TDD Without Shooting Yourself In The Foot
 
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
Decomposing the monolith into embeddable microservices using OWIN, WebHooks, ...
 
Strengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injectionStrengths and weaknesses of dependency injection
Strengths and weaknesses of dependency injection
 
Build Libraries That People Love To use
Build Libraries That People Love To useBuild Libraries That People Love To use
Build Libraries That People Love To use
 
Decomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you painDecomposing the Monolith using Microservices that don't give you pain
Decomposing the Monolith using Microservices that don't give you pain
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Decomposing the Monolith using modern-day .NET and a touch of microservices

  • 1. Dennis Doomen | @ddoomen | Aviva Solutions | The Continuous Improver
  • 3.
  • 4.
  • 5. Hybrid of Technologies Multiple patterns for the same problems Long compile time Large source control repositories Long-running unit tests Too much coupling Limited team scalability Devs need to know everything NoIsolation.Productivity drops over time. Proof of success!
  • 6.
  • 7. Application Functional Module Functional Module Functional Module Functional Module Composition Each module owns/exposes its master data Does not depend on anything except for curated shared APIs Owns schema and storage (may use shared database abstraction) DRY within module, not outside May use an internal container Does not touch other module’s data directly Shared Services Connects the modules and serves as anti- corruption layer Only services you really think should not be duplicated Designed according to Dependency Inversion Principle Covers front-end and back- end is the scope of unit & integration tests Align folder structure with boundaries Defines the contracts for the host as well as any services it exposes Aligned with Bounded Context.
  • 8.
  • 9.
  • 10.
  • 11. What is a microservice? From https://martinfowler.com/articles/microservices.html
  • 12. Very scalable, very reliable Very difficult to debug distributed problems Unreliable network requires resiliency techniques Requires message bus/broker/ gateway End-to-end testing very unpractical Very mature DevOps culture is a prerequisite Advanced monitoring and visualization is a must High operational maintenance Can be deployed/upgraded independently Explosion of network activity.
  • 13. The First Law of Distributed Computing
  • 14.
  • 15. Monolith Functional Module Functional Module Functional Module HTTP API HTTP API HTTP API Released as NuGet packageNo network I/O at all Own database instance, / shared with monolith / or shared storage service Owns the schema Separate repos with distinct owners Runs in-process, thus easier debugging New version requires redeployment of the monolith. Loose coupling through HTTP Less scalability options HTTP is not the fastest serialization format Designed for minimum dependencies
  • 16.
  • 17. Client IIS Console WinSvc Unit Test HTTP request HTTP response Middleware environment handler next Middleware IDictionary<string, object> Func<IDictionary<string, object>, Task> Task Func< Func<IDictionary<string, object>, Task>, Func<IDictionary<string, object>, Task> > Func<IDictionary<string, object>, Task>
  • 19. Monolith Functional Module HTTP API Module Registry Contract documented through OpenAPI Webhook Functional Module Functional Module Provides HTTP abstraction to connect to module Event payload exposed as OpenAPI Subscribers register HTTP abstraction Consumers use liberal JSON interpretation Subcribers can request resending history. Payload includes unique ID to help idempotency Each request requires correlation ID that flows through all APIs, webhooks and module
  • 20.
  • 21. Dennis Doomen | @ddoomen | The Continuous Improver Application Domain NoSQL / RDBMS OR/M / DAL Web UI, HTTP API, etc Lucene Index Document Projector Web UI, HTTP API, etc Web UI, HTTP API, etc Domain Commands Events Event StoreProjections Projectors Uses Event Sourcing Uses traditional CRUD architecture Indexing-based architecture Subcribe to webhooks Coarse- grained HTTP requests. Bus Subscribe Publish coarse- grained event
  • 22.
  • 23. Domain is persistency ignorant For modules that provide a (partial) UI or management screen Aggregates Command Handlers Commands Events Upconverters Value Objects Query Handlers Schema Migrations Projectors Data Importers Query API Projections HTML CSS JS API Controllers Projectors Projections Registrations Webhook API Command API Event Storage Domain Services Payload Definitions Can be tested independently Based on Domain Driven Design Outer layers depend on inner layers Master data
  • 24. Application Command Service Correct Customer Email Handler Customer Unit of Work Projector Data Access Layer Read Database Write Database CorrectCustomerEmailCommand HTTP API / In-process invocation Get<Customer>(identity) Correct Email Event Store Load(events) Apply Get changes CustomerEmailCorrectedEvent Submit changes History Dennis Doomen | @ddoomen | The Continuous Improver NES Aggregates.NET SimpleDomain NStore EventStore NEventStore SQLStreamStore NStore NES Marten Handelier Brighter MediatR (*) Projac LiquidProjections (*)
  • 25. Monolith Functional Module HTTP API Event Store Events Payload Projector Subscription Request Payload ‘event store’ Have their own checkpoints Projects fine-grained events into payload projections Projector Projector Projector Webhook Projectors Separate instance per subscription Subscriber Callback API ‘Project’ payload ‘events’ into HTTP calls Projected Data Uses the incoming payloads as an ‘event store’. Payload SQL DB Schema changes using code or using NoSQL Subscription Request
  • 26.
  • 27. - Module owns ‘schema’ - Supports upgrading and downgrading - NoSQL preferred, but RDBMS can work too.
  • 28. Event Store Projector Application Version 2 Owns schema (e.g. FluentMigrator) Version 1 X Involves down-time until projections are rebuild Dennis Doomen | @ddoomen | The Continuous Improver
  • 29. Event Store Projector Application Application Network Load Balancer Event Store Version 1 Version 2 events Projection ProjectorProjection bring off-line Returns HTTP 503 (Service Unavailable) Dennis Doomen | @ddoomen | The Continuous Improver Returns HTTP 503 (Service Unavailable)
  • 30.
  • 31.
  • 32. Dennis Doomen | @ddoomen | The Continuous Improver
  • 33. var mapBuilder = new EventMapBuilder<MyContext, DocumentProjection, string>(); mapBuilder .Map<WarrantAssignedEvent>() .AsCreateOf(anEvent => anEvent.Number) .Using((document, anEvent) => { document.Type = "Warrant"; document.Kind = anEvent.Kind; document.Country = anEvent.Country; document.State = anEvent.InitialState; }); mapBuilder .Map<StateTransitionedEvent>() .When(anEvent => anEvent.State != "Closed") .AsUpdateOf(anEvent => anEvent.DocumentNumber) .Using((document, anEvent) => document.State = anEvent.State); Dennis Doomen | @ddoomen | The Continuous Improver
  • 34. var stats = new ProjectionStats(() => DateTime.UtcNow); stats.StoreProperty("CountByDocument", "some setting key", "some value"); stats.LogEvent("CountByDocument", "some significant thing that happened"); stats.TrackProgress("CountByDocument", currentCheckpoint); float? transactionsPerSecond = stats.GetSpeed("CountByDocument"); TimeSpan? eta = stats.GetTimeToReach("CountByDocument", targetCheckpoint); public void Configure(IAppBuilder builder) { builder.UseStatistics(stats); } Dennis Doomen | @ddoomen | The Continuous Improver
  • 35. IAppBuilder builder = …. builder.UseStatistics(stats); GET http://localhost/projectionStats/CountByDocument { "projectorId": "CountByDocument", "lastCheckpoint": 1000, "lastCheckpointUpdatedUtc": "2018-05-10T10:39:00Z", "properties": [{ "key": "some setting key", "value": "some value", "lastUpdatedUtc": "2018-05-10T10:39:00Z" }], "eventsUrl": "http://localhost/projectionStats/CountByDocument/events" } Dennis Doomen | @ddoomen | The Continuous Improver
  • 36.
  • 37. Service Host Monolith Functional Module Functional Module Functional Module HTTP API HTTP API HTTP API Apply routing conventions Versioning using Accept Headers, Response Headers or Routes Optimize body using AVRO or Protobuf Cross-service tracing using OpenTracing Replace HTTP with gRPC Common contracts for diagnostics, monitoring HTTP Proxy Child process of monolith (e.g. LitteForker) Hides the externalized state of the module (e.g. ProxyKit)
  • 38.
  • 39. 1 Build a (container-based) cloud capability. 2 Deploy monolith to the cloud. 3 Automate your delivery pipeline. 4 Full end-to-end responsibility 5 Evaluate status-quo on micro-services (products, platforms, etc) 6 Slide-and-dice microservices one-by- one 7 Break-up delivery teams and code.
  • 40. Dennis Doomen @ddoomen Dennis Doomen | @ddoomen | The Continuous Improver
  • 41. • Liquid Projections https://www.liquidprojections.net • Bliki: MonolithFirst https://dzone.com/articles/martin-fowler%E2%80%94bliki • In-process gRPC https://github.com/grpc/grpc-go/issues/906 • Ingredients for well-designed OWIN components https://www.continuousimprover.com/search/label/OWIN%20 Recipes • The good, the bad and the ugly of Event Sourcing https://www.continuousimprover.com/search/label/event%20s ourcing
  • 42. • Aggregates.NET https://github.com/volak/Aggregates.NET • EventFlow https://github.com/eventflow/EventFlow • OWIN in ASP.NET Core https://docs.microsoft.com/en- us/aspnet/core/fundamentals/owin?view=aspnetcore-2.1 • Nested ASP.NET Core applications http://dhickey.ie/2018/06/09/aspnet-core-nested-apps/ • LittleForker https://github.com/damianh/LittleForker • ProxyKit https://github.com/ProxyKit/ProxyKit
  • 43.
  • 44. Domain Event Store Events App RDBMS Events Projection EventsProjection Projection Projector Optimized for specific queries Separate projections database NoSQL Projector Projection-specific storage Projector HTML Raw SQL or Dapper Run asynchronously Great for sharding Dennis Doomen | @ddoomen | The Continuous Improver
  • 45. Events Transaction 6 Transaction 5 Transaction 4 Transaction 3 Transaction 2 Transaction 1 Temporal Projector Read Store Time Projected until this point Immutable, thus auditable and SOX compliance Dennis Doomen | @ddoomen | The Continuous Improver
  • 47. Dennis (v4) Persisted State Changes Dennis (v3) Role Granted PasswordChangedEvent Dennis (v4) Dennis (v3) User Created Role Granted Phone Number Added Password Changed Dennis (v5) Role Revoked Dennis (v6) Role Granted Time Dennis (v7) Password Changed Dennis Doomen | @ddoomen | The Continuous Improver
  • 50.
  • 53. Bad choice in functional keys (e.g. username vs ID)
  • 54. Running business logic after an domain event is raised
  • 56.
  • 58. Driven by invariants, not composition Only consistent within aggregate Small aggregates Reference by identity
  • 59.
  • 60. • Column constraints (e.g. data truncation) • Changes in data invariants (null vs non- null in event versions) • Unexpected projection dependencies • Partial replays.
  • 61. • Causing duplicate child records • Causing large event streams • Incorrect caching strategy (e.g. on lookups) • Identity case-sensitivity • Incomplete SQL-backed event store reads.
  • 62. • Side by side rebuilding • Functional archivability and archiving • Projection tracking and ETAs • Prioritization • Partitioning.
  • 63. • After bugs, schema changes, etc • Manual or automatic (e.g. hashes)
  • 64.
  • 65. Microservice Bunch of classes that should be used directly X No inheritance Uses composition over inheritance internally Convenience classes that don’t hide the magic Library Abstract Package Interfaces Delegates DTOs Only depend on abstract packages… Stable Package …or depend on more stable packages Auxiliary Package Classes that are not used together do not belong togetherOptional Dependency Dependency Package Consumers should not be faced with optional dependencies
  • 66.
  • 67.
  • 68. public interface IEventStore { IDisposable Subscribe( long? lastCheckpoint, Func<Transaction[]>, Task> handler, string subscriptionId); } public delegate IDisposable CreateSubscription( long? lastCheckpoint, Func<Transaction[]>, Task> handler, string subscriptionId);
  • 69. e.g. LibLog, TinyIoc, FluidCaching
  • 70.
  • 71.
  • 72. • The network is reliable • Latency is zero • Bandwidth is infinite • The network is secure • Topology doesn't change • There is one administrator • Transport cost is zero • The network is homogeneous. https://en.wikipedia.org/wiki/Fallacies_of_distributed_computing