SlideShare a Scribd company logo
1 of 39
Applying ADSD and NServiceBus
1
Introduction
2
Who we are?
● For around 20 years, Strasz Assessment Systems has provided solutions for the Assessments
industry, so typically, our clients offer education, certification or licensure programs.
● The system we will be talking about today is the one we have built for one of our largest clients, the
AICPA.
● The AICPA produces, delivers and scores the Uniform CPA exam.
● Our end to end solution for them includes content authoring of test questions, automated assembly
into an exam, delivery in a test center, scoring, reporting and invoicing
● Some of our other clients include AAMC who offer the MCAT exam, Inteleos who offer sonography
and physician certifications, and NCCPA who certify physician assistants.
3
Technology Stack
4
Technology Stack
● We are currently in the middle of a cloud migration effort. So our latest technology stack is
NServiceBus, .Net core, Azure Functions, Azure Cosmos Db, Azure Service Bus, Azure Cognitive
Search, Angular & Typescript and MonoRepo with NX.
● On the other hand, the CPA exam was computerised in the early 2000s so there are a lot of legacy
technologies in play.
● Our on-prem stack includes NServiceBus, RabbitMQ, RavenDb and SQL Server
● We also use IBM CPLEX engine which uses linear programming and user defined constraints to
automate exam creation.
5
Need for SOA
6
CPA Exam Administration
7
AICPA Systems and Data Flow
8
Example: Test Question (Item)
9
CMS: Need for SOA
● CPA exam computerized around 20 years ago
○ Model mirrors database structure
○ Business Rules Implicit in the system
● Example issue with CMS
○ Different aspects of an Item that CMS needs to support
■ Question
■ Scoring Rules
■ Inventory
■ Statistics
■ Reference management
■ Classification management
○ Technical coupling of separate business capabilities.
10
CMS: Need for SOA
● Example issue with CMS
○ Item development goes through various lifecycle stages from Conception to PreTest to Operational
■ Complex and inter-dependent workflows, reviews, validation rules
○ Snapshot for rescore or re-reporting
■ Candidate may request rescore for an exam they took in the past.
○ Increased cost of change
11
Duplication: Need for SOA
● Example issue with Adaptive Routing
12
Duplication: Need for SOA
● Example issue with Adaptive Routing
○ Routing rules and logic are imported into every system.
○ In SOA, a single service owns this data and behavior, not systems.
13
CMS: Scoring Rules (Before)
14
“Whatever the cause, software that lacks a concept at the foundation of its design is, at best, a mechanism that does useful things without
explaining its actions.”
― Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software
CMS: Scoring Rules Service (After)
15
Challenges we faced
16
Challenges
● Getting buy in from business.
○ Though we have an excellent product team, we rightly needed to show that we were not further
complicating the system.
○ External review of our codebase and SOA proposal by Paul Rayner who is one of the leading voices in
the DDD community.
● Getting developer buy-in, thanks to our practice and commitment to Continuous Learning we were
able to slowly but surely get the team on-board.
● Doing the actual work was challenging too. Unlike tactical DDD patterns, it was difficult to find a
reference architecture for ADSD
○ Trust the team’s collective background in design and we engaged Particular software (Mauro Servienti)
to consult with us I think a couple of hours every week during implementation
17
Finding Service Boundaries
18
Finding Service Boundaries
● Udi talks about slicing an entity based on which properties participate in a transaction and which ones
never will.
● For folks with DDD background, you can pay attention to language. For example in the context of
Questions, an item has response fields, stem, stimulus, widgets and exhibits. In the context of Scoring
rules item has Measurement Opportunities, Keys, Assertions.
● Other ways to find boundaries if you have a large relational database is to look at all the tables and see
which ones have more relationships between them. They are likely to be more cohesive.
● Remember the share nothing approach above all else. Only Ids can be shared. When correct service
boundaries are established they will seem obvious.
● We even discovered a service boundary when deep into implementation. Routing rules between
segments in an exam for example - intro, break, timeout, survey are different from routing rules
between test questions.
19
ADSD Course: Benefits
20
ADSD Course: Benefits
● Our architects attended the course in NYC.
● Having watched Udi’s presentations over the years the course helped connect a lot of the concepts
we had heard from him.
● We had extracted one bounded context/service from our Cms monolith, the one for Scoring rules.
● We were struggling with Composite UI questions in extracting more boundaries.
● Technical services like ItOps and Branding critical to eliminating data duplication
● Having our architects attend the course also meant that it was easier to bring the rest of the
development team along.
21
Rolling your own messaging framework
22
Rolling your own messaging framework
● Our history is we had MSMQ on-prem, then RabbitMq on prem (since .Net core does not support
DTC), then Azure Storage Queues (because it seemed ridiculously inexpensive) and now we are using
Azure Service Bus.
● Easier to switch transport because it sits behind an NServicebus abstraction.
● Messaging design patterns like Sagas/ProcessManager, Outboxing and even behaviors like
ReplyToOriginator are complex and not easy to roll on your own.
● Each transport offers different delivery guarantees and has different limitations, so you are likely going
to write a lot of plumbing code.
● Time spent writing plumbing code = time not spent working on business logic.
● Best to source infrastructure code from the community. You cannot keep up yourself. for ex - even
log4net does not support structured logging yet.
23
Applying NServiceBus
24
Sagas: Process Manager
● Compare with Point to Point interaction
● CQRS journey example (Before) -
25
Sagas: Process Manager
● CQRS journey example (After) -
26
Sagas: Process Manager Example
● Vendor Import
27
Sagas: Domain Model Example
● Percent Correct Scoring Policy
28
Service with Sagas as Aggregates
29
Sagas: Testability
30
Sagas: Benefits
● Model Business Process and manage Process State
● Handle out of order messages in the overall operation.
● Engage domain experts for compensating actions
● No need for data retrieval, save, concurrency checks
● Small aggregate boundaries
● Testable
31
Composite UI
32
Request Interceptor: Server
33
Request Interceptor: Server
34
Request Interceptor: Client
35
Other Code Samples
36
Request Interceptor (with Subscription): Server
37
Service with Functions As ACs
38
NServiceBus Style Handlers: Client
39

More Related Content

Similar to Tales from the trenches creating complex distributed systems

EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?Simerjeet Singh
 
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docx
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docxCHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docx
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docxcravennichole326
 
Blue Lang - Engineering Leader
Blue Lang - Engineering LeaderBlue Lang - Engineering Leader
Blue Lang - Engineering LeaderBlue Lang
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsThousandEyes
 
Adopting the open group cloud eco system reference model
Adopting the open group cloud eco system reference modelAdopting the open group cloud eco system reference model
Adopting the open group cloud eco system reference modelKrishna-Kumar
 
Owasp summit slides day 2
Owasp summit slides day 2Owasp summit slides day 2
Owasp summit slides day 2Dinis Cruz
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashvilleNathaniel (Ned) Bauerle
 
"Digital transformation and innovations implementation. Architectural points ...
"Digital transformation and innovations implementation. Architectural points ..."Digital transformation and innovations implementation. Architectural points ...
"Digital transformation and innovations implementation. Architectural points ...Fwdays
 
Microservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learnedMicroservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learnedLuram Archanjo
 
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...NETWAYS
 
Case Study - Enabing an Insurance Organization - CMS IT SERVICES
Case Study - Enabing an Insurance Organization - CMS IT SERVICESCase Study - Enabing an Insurance Organization - CMS IT SERVICES
Case Study - Enabing an Insurance Organization - CMS IT SERVICESCMS IT SERVICES (Admin)
 
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)Razorleaf Corporation
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveWalid Shaari
 
Architecturing the software stack at a small business
Architecturing the software stack at a small businessArchitecturing the software stack at a small business
Architecturing the software stack at a small businessYangJerng Hwa
 
WDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxWDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxArthur240715
 

Similar to Tales from the trenches creating complex distributed systems (20)

EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?EliteMindz: Who are we? Where do we serve ? What are our products & services?
EliteMindz: Who are we? Where do we serve ? What are our products & services?
 
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docx
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docxCHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docx
CHAPTER 10 SystemArchitectureChapter 10 is the final chapter.docx
 
Blue Lang - Engineering Leader
Blue Lang - Engineering LeaderBlue Lang - Engineering Leader
Blue Lang - Engineering Leader
 
Getting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of ConceptsGetting Started with ThousandEyes Proof of Concepts
Getting Started with ThousandEyes Proof of Concepts
 
Adopting the open group cloud eco system reference model
Adopting the open group cloud eco system reference modelAdopting the open group cloud eco system reference model
Adopting the open group cloud eco system reference model
 
Owasp summit slides day 2
Owasp summit slides day 2Owasp summit slides day 2
Owasp summit slides day 2
 
Microdeployments for microservices dev ops nashville
Microdeployments for microservices   dev ops nashvilleMicrodeployments for microservices   dev ops nashville
Microdeployments for microservices dev ops nashville
 
"Digital transformation and innovations implementation. Architectural points ...
"Digital transformation and innovations implementation. Architectural points ..."Digital transformation and innovations implementation. Architectural points ...
"Digital transformation and innovations implementation. Architectural points ...
 
Rushcode overview
Rushcode overviewRushcode overview
Rushcode overview
 
ESP POC Findings
ESP POC FindingsESP POC Findings
ESP POC Findings
 
SOA 911
SOA 911SOA 911
SOA 911
 
Microservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learnedMicroservices as an evolutionary architecture: lessons learned
Microservices as an evolutionary architecture: lessons learned
 
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...
OSMC 2022 | Scaling SLOs with K8s and Cloud-native Observability by George Ha...
 
Case Study - Enabing an Insurance Organization - CMS IT SERVICES
Case Study - Enabing an Insurance Organization - CMS IT SERVICESCase Study - Enabing an Insurance Organization - CMS IT SERVICES
Case Study - Enabing an Insurance Organization - CMS IT SERVICES
 
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)
AU 2014: Autodesk PLM 360 Success Story with Inphi (TECH PAPER)
 
Network Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspectiveNetwork Automation Journey, A systems engineer NetOps perspective
Network Automation Journey, A systems engineer NetOps perspective
 
Arunprakash Alagesan
Arunprakash AlagesanArunprakash Alagesan
Arunprakash Alagesan
 
Architecturing the software stack at a small business
Architecturing the software stack at a small businessArchitecturing the software stack at a small business
Architecturing the software stack at a small business
 
WDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptxWDS trainer presentation - MLOps.pptx
WDS trainer presentation - MLOps.pptx
 
Siva visual Resume.docx
Siva visual Resume.docxSiva visual Resume.docx
Siva visual Resume.docx
 

More from Particular Software

Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusParticular Software
 
Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Particular Software
 
An exception occurred - Please try again
An exception occurred - Please try againAn exception occurred - Please try again
An exception occurred - Please try againParticular Software
 
Implementing outbox model-checking first
Implementing outbox   model-checking firstImplementing outbox   model-checking first
Implementing outbox model-checking firstParticular Software
 
Reports from the field azure functions in practice
Reports from the field   azure functions in practiceReports from the field   azure functions in practice
Reports from the field azure functions in practiceParticular Software
 
Finding your service boundaries - a practical guide
Finding your service boundaries - a practical guideFinding your service boundaries - a practical guide
Finding your service boundaries - a practical guideParticular Software
 
Decomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerDecomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerParticular Software
 
DIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesDIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesParticular Software
 
Share the insight of ServiceInsight
Share the insight of ServiceInsightShare the insight of ServiceInsight
Share the insight of ServiceInsightParticular Software
 
What to consider when monitoring microservices
What to consider when monitoring microservicesWhat to consider when monitoring microservices
What to consider when monitoring microservicesParticular Software
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusParticular Software
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusParticular Software
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfallsParticular Software
 
Connect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingConnect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingParticular Software
 
Async/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateAsync/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateParticular Software
 
Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Particular Software
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRSParticular Software
 

More from Particular Software (20)

Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBusScaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
 
Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code Beyond simple benchmarks—a practical guide to optimizing code
Beyond simple benchmarks—a practical guide to optimizing code
 
An exception occurred - Please try again
An exception occurred - Please try againAn exception occurred - Please try again
An exception occurred - Please try again
 
Got the time?
Got the time?Got the time?
Got the time?
 
Implementing outbox model-checking first
Implementing outbox   model-checking firstImplementing outbox   model-checking first
Implementing outbox model-checking first
 
Reports from the field azure functions in practice
Reports from the field   azure functions in practiceReports from the field   azure functions in practice
Reports from the field azure functions in practice
 
Finding your service boundaries - a practical guide
Finding your service boundaries - a practical guideFinding your service boundaries - a practical guide
Finding your service boundaries - a practical guide
 
Decomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and DockerDecomposing .NET Monoliths with NServiceBus and Docker
Decomposing .NET Monoliths with NServiceBus and Docker
 
DIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenchesDIY Async Message Pump: Lessons from the trenches
DIY Async Message Pump: Lessons from the trenches
 
Share the insight of ServiceInsight
Share the insight of ServiceInsightShare the insight of ServiceInsight
Share the insight of ServiceInsight
 
What to consider when monitoring microservices
What to consider when monitoring microservicesWhat to consider when monitoring microservices
What to consider when monitoring microservices
 
Making communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBusMaking communications across boundaries simple with NServiceBus
Making communications across boundaries simple with NServiceBus
 
Making communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service BusMaking communication across boundaries simple with Azure Service Bus
Making communication across boundaries simple with Azure Service Bus
 
How to avoid microservice pitfalls
How to avoid microservice pitfallsHow to avoid microservice pitfalls
How to avoid microservice pitfalls
 
Connect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and MessagingConnect front end to back end using SignalR and Messaging
Connect front end to back end using SignalR and Messaging
 
Async/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API UpdateAsync/Await: NServiceBus v6 API Update
Async/Await: NServiceBus v6 API Update
 
Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps Async/Await: TPL & Message Pumps
Async/Await: TPL & Message Pumps
 
Async/Await Best Practices
Async/Await Best PracticesAsync/Await Best Practices
Async/Await Best Practices
 
Making workflow implementation easy with CQRS
Making workflow implementation easy with CQRSMaking workflow implementation easy with CQRS
Making workflow implementation easy with CQRS
 
Cqrs but different
Cqrs but differentCqrs but different
Cqrs but different
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
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
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 

Tales from the trenches creating complex distributed systems

  • 1. Applying ADSD and NServiceBus 1
  • 3. Who we are? ● For around 20 years, Strasz Assessment Systems has provided solutions for the Assessments industry, so typically, our clients offer education, certification or licensure programs. ● The system we will be talking about today is the one we have built for one of our largest clients, the AICPA. ● The AICPA produces, delivers and scores the Uniform CPA exam. ● Our end to end solution for them includes content authoring of test questions, automated assembly into an exam, delivery in a test center, scoring, reporting and invoicing ● Some of our other clients include AAMC who offer the MCAT exam, Inteleos who offer sonography and physician certifications, and NCCPA who certify physician assistants. 3
  • 5. Technology Stack ● We are currently in the middle of a cloud migration effort. So our latest technology stack is NServiceBus, .Net core, Azure Functions, Azure Cosmos Db, Azure Service Bus, Azure Cognitive Search, Angular & Typescript and MonoRepo with NX. ● On the other hand, the CPA exam was computerised in the early 2000s so there are a lot of legacy technologies in play. ● Our on-prem stack includes NServiceBus, RabbitMQ, RavenDb and SQL Server ● We also use IBM CPLEX engine which uses linear programming and user defined constraints to automate exam creation. 5
  • 8. AICPA Systems and Data Flow 8
  • 10. CMS: Need for SOA ● CPA exam computerized around 20 years ago ○ Model mirrors database structure ○ Business Rules Implicit in the system ● Example issue with CMS ○ Different aspects of an Item that CMS needs to support ■ Question ■ Scoring Rules ■ Inventory ■ Statistics ■ Reference management ■ Classification management ○ Technical coupling of separate business capabilities. 10
  • 11. CMS: Need for SOA ● Example issue with CMS ○ Item development goes through various lifecycle stages from Conception to PreTest to Operational ■ Complex and inter-dependent workflows, reviews, validation rules ○ Snapshot for rescore or re-reporting ■ Candidate may request rescore for an exam they took in the past. ○ Increased cost of change 11
  • 12. Duplication: Need for SOA ● Example issue with Adaptive Routing 12
  • 13. Duplication: Need for SOA ● Example issue with Adaptive Routing ○ Routing rules and logic are imported into every system. ○ In SOA, a single service owns this data and behavior, not systems. 13
  • 14. CMS: Scoring Rules (Before) 14 “Whatever the cause, software that lacks a concept at the foundation of its design is, at best, a mechanism that does useful things without explaining its actions.” ― Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software
  • 15. CMS: Scoring Rules Service (After) 15
  • 17. Challenges ● Getting buy in from business. ○ Though we have an excellent product team, we rightly needed to show that we were not further complicating the system. ○ External review of our codebase and SOA proposal by Paul Rayner who is one of the leading voices in the DDD community. ● Getting developer buy-in, thanks to our practice and commitment to Continuous Learning we were able to slowly but surely get the team on-board. ● Doing the actual work was challenging too. Unlike tactical DDD patterns, it was difficult to find a reference architecture for ADSD ○ Trust the team’s collective background in design and we engaged Particular software (Mauro Servienti) to consult with us I think a couple of hours every week during implementation 17
  • 19. Finding Service Boundaries ● Udi talks about slicing an entity based on which properties participate in a transaction and which ones never will. ● For folks with DDD background, you can pay attention to language. For example in the context of Questions, an item has response fields, stem, stimulus, widgets and exhibits. In the context of Scoring rules item has Measurement Opportunities, Keys, Assertions. ● Other ways to find boundaries if you have a large relational database is to look at all the tables and see which ones have more relationships between them. They are likely to be more cohesive. ● Remember the share nothing approach above all else. Only Ids can be shared. When correct service boundaries are established they will seem obvious. ● We even discovered a service boundary when deep into implementation. Routing rules between segments in an exam for example - intro, break, timeout, survey are different from routing rules between test questions. 19
  • 21. ADSD Course: Benefits ● Our architects attended the course in NYC. ● Having watched Udi’s presentations over the years the course helped connect a lot of the concepts we had heard from him. ● We had extracted one bounded context/service from our Cms monolith, the one for Scoring rules. ● We were struggling with Composite UI questions in extracting more boundaries. ● Technical services like ItOps and Branding critical to eliminating data duplication ● Having our architects attend the course also meant that it was easier to bring the rest of the development team along. 21
  • 22. Rolling your own messaging framework 22
  • 23. Rolling your own messaging framework ● Our history is we had MSMQ on-prem, then RabbitMq on prem (since .Net core does not support DTC), then Azure Storage Queues (because it seemed ridiculously inexpensive) and now we are using Azure Service Bus. ● Easier to switch transport because it sits behind an NServicebus abstraction. ● Messaging design patterns like Sagas/ProcessManager, Outboxing and even behaviors like ReplyToOriginator are complex and not easy to roll on your own. ● Each transport offers different delivery guarantees and has different limitations, so you are likely going to write a lot of plumbing code. ● Time spent writing plumbing code = time not spent working on business logic. ● Best to source infrastructure code from the community. You cannot keep up yourself. for ex - even log4net does not support structured logging yet. 23
  • 25. Sagas: Process Manager ● Compare with Point to Point interaction ● CQRS journey example (Before) - 25
  • 26. Sagas: Process Manager ● CQRS journey example (After) - 26
  • 27. Sagas: Process Manager Example ● Vendor Import 27
  • 28. Sagas: Domain Model Example ● Percent Correct Scoring Policy 28
  • 29. Service with Sagas as Aggregates 29
  • 31. Sagas: Benefits ● Model Business Process and manage Process State ● Handle out of order messages in the overall operation. ● Engage domain experts for compensating actions ● No need for data retrieval, save, concurrency checks ● Small aggregate boundaries ● Testable 31
  • 37. Request Interceptor (with Subscription): Server 37