SlideShare a Scribd company logo
Enterprise Developers Guild
9/26/2017
Microservices
Primer for
Monolithic Devs
1
2
3
4
5
Agenda
Microservices Overview
Service and API Boundaries
Designing for Distributed Data
Managing Microservices
Demo with Azure Service Fabric
GOAL: Understand what to expect on Microservices projects
Impact of Modern Apps
 Users expect more features without downtime
 Developers have to figure out a solution
Monolith vs. Microservices
Monolithic SOA Microservices
Evolution of Architectures
GoF Patterns, SOLID, Hexagonal, Testable
Use Cases – App Features
 SaaS product
 Availability critical
 Variable I/O & Scale
 Variant feature changes
Use Cases – Business Features
 Remain competitive – QTM
 Evolving business model
 Acquisition-based model
When to start with monoliths
(Realistically – Most of the time)
 Unknown growth/adoption
 Boundaries not well-defined
 No DevOps culture
MSDN
Determining
Service
Boundaries
DDD: Bounded Context
“Bounding contexts gives team
members a clear and shared
understanding of what has to
be consistent and what can
develop independently.”
- Eric Evans, Domain-Driven Design, 2003
Bounded Context Example
Course
Subject
Student
Class Schedule
Faculty
Advisor
Bounded Context Example
Course
Subject
Student
Class ScheduleCourse ID Faculty
Member
Advisor ID
(Faculty Member)
Add/Edit courses
Add/Edit students,
Set semester class schedule
Add/Edit
faculty members
The Microservices Version
Entities & Processes
Services boundaries tend to be separated by nouns & verbs
Student
Service
Course
Service
NOUNS (Entity CRUD)
Batch
Enrollment
Search
Prospects
VERBS (Business Process)
Optional Monolithic Start
 Bounded Contexts
 Variable Scaling
 Change Frequency
 Business Process
Start large and break down based on:
EXAMPLE: EF Bounded Context
// Typical EF setup with all data models in single DB context
public class SchoolDbContext : DbContext, ISchoolDbContext
{
public DbSet<Student> Students { get; set; }
public DbSet<Course> Courses { get; set; }
public DbSet<Subject> Subjects { get; set; }
public DbSet<Faculty> Faculty { get; set; }
public DbSet<FacultyMember> FacultyMembers { get; set; }
}
EXAMPLE: EF Bounded Context
// Contexts grouped by entities w/ related, specific operations
public class StudentDbContext : DbContext
{
public DbSet<Student> Students { get; set; }
public DbSet<ClassSchedule> ClassSchedules { get; set; }
}
public class CourseDbContext : DbContext { }
public class FacultyDbContext : DbContext { }
MSDN
Managing
APIs
API Death Stars
API Gateway
Follow good REST principles
 Resource hierarchies
 HTTP methods & status codes
GET /students/123/schedule/2017 | 200
POST /students/123/schedule | 201
PUT ...
PATCH ...
DELETE ...
Versioning
URI
/v1/students/123
Query String
/students/123?v=1.0
Accept Header
/students/123
Accept: x.student-api.v1+json
MSDN
Managing
Distributed
Data
Monolith Queries
SELECT -- Syllabus and advisor info
FROM StudentSyllabus ss
INNER JOIN Syllabus s ON ss.SyllabusId = s.Id
INNER JOIN Course c ON s.CourseId = c.Id
INNER JOIN Advisor a ON ss.AdvisorId = a.Id
INNER JOIN [User] u ON a.UserId = u.Id
WHERE ss.[Year] = @currentYear
AND ss.StudentId = @studentId
AND ss.IsActive = 1
Querying Distributed Databases
Cross-Service Queries
Cross-Service Queries
fetch('/api/v1/students/12345/schedule/2017')
.then((response) => response.json())
.then(function(student) {
// Call the other services to get “join” data
var advisorApi = '/api/v1/faculty/members/' + student.advisorId;
var courseApis = [];
student.courses.forEach(function(course) {
courseApis.push('/api/v1/courses/' + course.id);
}, this);
// Create promises, merge results, data binding, etc.
});
Materialized Views
Materialized Views
fetch('/api/v1/students/12345/syllabus/2017')
.then((response) => response.json())
.then(function(student) {
// Call the other services to get “join” data
var advisorApi = '/api/v1/faculty/members/' + student.advisorId;
var courseApis = [];
student.courses.forEach(function(course) {
courseApis.push('/api/v1/courses/' + course.id);
}, this);
// Create promises, merge results, data binding, etc.
});
// Trade-off is more backend code for event publishing
fetch('/api/v1/students/12345/schedule/2017’).then(...)
Monolith Commands
using (IDbContext db = _dbFactory.GetContext())
{
Syllabus syllabusDataModel = db.Syllabus.Single(s =>
s.Id == syllabusDomainModel.Id);
Mapper.MapChanges(
syllabusDataModel, syllabusDomainModel);
// Built-in transactions for related tables
db.SaveChanges();
}
Eventually Consistent Services
Event Sourcing
Managing
Microservices
Team DevOps
Repos Builds Releases
Unit Testing
Internal Logic
• In-memory only
• Mock/fake dependencies
Unit Testing
Owned Dependencies
• Provisioning/Teardown
• Longer duration
Unit Testing
Non-Owned Dependencies
• Contracts
• Consumer vs. Provider
Platform Checklist
 Frameworks
 Logging
 Monitoring
 Auto Scaling
 Service Discovery
 Instant Rollback
 Auto Versioning
 Failure Resistance
 Self-Service Provisioning
 Rapid Deployment
To run microservices, you need:
Platforms
PaaS CaaS IaaS
 Azure Service Fabric
 Pivotal Cloud Foundry
 Cloud w/ Frameworks:
 Netflix OSS
 Mantl
 Amazon ECS
 Azure Container
Services
 Google Container
Engine
 VMs
Tools/Frameworks/Libraries
Event Stores
 Eventuate
 Cosmos DB Change Feed
 eventstore.org
Service Discovery
 Service Fabric Naming Service
 Consul
 Netflix Eureka
API Gateway
 Azure/AWS API Management
 Mulesoft
 Google Apigee
Event Messaging
 Azure/AWS queue services
 Apache Kafka
 RabbitMQ
More Info
Questions? lfaulkner@cardinalsolutions.com
Design patterns and technical approaches:
http://microservices.io/
https://docs.microsoft.com/en-us/azure/architecture/ (Cloud Patterns PDF)
https://martinfowler.com/articles/microservices.html
How they did it:
http://searchmicroservices.techtarget.com/ (RSS)
https://medium.com/netflix-techblog
https://blogs.msdn.microsoft.com/bharry/ (How the VSTS team does it)

More Related Content

Similar to Microservices Primer for Monolithic Devs

Cursos sql server .net visual basic octubre 2010
Cursos sql server .net visual basic octubre 2010 Cursos sql server .net visual basic octubre 2010
Cursos sql server .net visual basic octubre 2010
Servicios Educativos Softrain C.A.
 
Designing Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDIDesigning Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDI
Michel Graciano
 
Lessons learned teaching a groovy grails course
Lessons learned teaching a groovy grails courseLessons learned teaching a groovy grails course
Lessons learned teaching a groovy grails course
JacobAae
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
Rob Windsor
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
Mohammed Arif
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
Paul Withers
 
Scalable java script applications
Scalable java script applicationsScalable java script applications
Scalable java script applications
Good Robot
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
Chalermpon Areepong
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar intro
Leonid Maslov
 
jquery summit presentation for large scale javascript applications
jquery summit  presentation for large scale javascript applicationsjquery summit  presentation for large scale javascript applications
jquery summit presentation for large scale javascript applications
DivyanshGupta922023
 
Java Technology
Java TechnologyJava Technology
Java Technology
ifnu bima
 
Building a scalable web application by combining modern front-end stuff and A...
Building a scalable web application by combining modern front-end stuff and A...Building a scalable web application by combining modern front-end stuff and A...
Building a scalable web application by combining modern front-end stuff and A...
Chris Klug
 
Data access
Data accessData access
Data access
Joshua Yoon
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
Edureka!
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
Edureka!
 
A Groovy Way to Interface With Cascade Server
A Groovy Way to Interface With Cascade ServerA Groovy Way to Interface With Cascade Server
A Groovy Way to Interface With Cascade Server
hannonhill
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
amitarcade
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
BALUJAINSTITUTE
 
Sakai and IMS LIS Integration
Sakai and IMS LIS IntegrationSakai and IMS LIS Integration
Sakai and IMS LIS Integration
Cris Holdorph
 
3.java database connectivity
3.java database connectivity3.java database connectivity
3.java database connectivity
web360
 

Similar to Microservices Primer for Monolithic Devs (20)

Cursos sql server .net visual basic octubre 2010
Cursos sql server .net visual basic octubre 2010 Cursos sql server .net visual basic octubre 2010
Cursos sql server .net visual basic octubre 2010
 
Designing Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDIDesigning Java EE Applications in the Age of CDI
Designing Java EE Applications in the Age of CDI
 
Lessons learned teaching a groovy grails course
Lessons learned teaching a groovy grails courseLessons learned teaching a groovy grails course
Lessons learned teaching a groovy grails course
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
MVC & backbone.js
MVC & backbone.jsMVC & backbone.js
MVC & backbone.js
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
Scalable java script applications
Scalable java script applicationsScalable java script applications
Scalable java script applications
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
1. Mini seminar intro
1. Mini seminar intro1. Mini seminar intro
1. Mini seminar intro
 
jquery summit presentation for large scale javascript applications
jquery summit  presentation for large scale javascript applicationsjquery summit  presentation for large scale javascript applications
jquery summit presentation for large scale javascript applications
 
Java Technology
Java TechnologyJava Technology
Java Technology
 
Building a scalable web application by combining modern front-end stuff and A...
Building a scalable web application by combining modern front-end stuff and A...Building a scalable web application by combining modern front-end stuff and A...
Building a scalable web application by combining modern front-end stuff and A...
 
Data access
Data accessData access
Data access
 
Getting Started with Spring Framework
Getting Started with Spring FrameworkGetting Started with Spring Framework
Getting Started with Spring Framework
 
Principles of MVC for Rails Developers
Principles of MVC for Rails DevelopersPrinciples of MVC for Rails Developers
Principles of MVC for Rails Developers
 
A Groovy Way to Interface With Cascade Server
A Groovy Way to Interface With Cascade ServerA Groovy Way to Interface With Cascade Server
A Groovy Way to Interface With Cascade Server
 
Introduction to design_patterns
Introduction to design_patternsIntroduction to design_patterns
Introduction to design_patterns
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
Sakai and IMS LIS Integration
Sakai and IMS LIS IntegrationSakai and IMS LIS Integration
Sakai and IMS LIS Integration
 
3.java database connectivity
3.java database connectivity3.java database connectivity
3.java database connectivity
 

Recently uploaded

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
architagupta876
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
SakkaravarthiShanmug
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
IJECEIAES
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
abbyasa1014
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 

Recently uploaded (20)

KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
AI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptxAI assisted telemedicine KIOSK for Rural India.pptx
AI assisted telemedicine KIOSK for Rural India.pptx
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
cnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classicationcnn.pptx Convolutional neural network used for image classication
cnn.pptx Convolutional neural network used for image classication
 
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
Engineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdfEngineering Drawings Lecture Detail Drawings 2014.pdf
Engineering Drawings Lecture Detail Drawings 2014.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 

Microservices Primer for Monolithic Devs

Editor's Notes

  1. Poll audience – have used microservices; have not but experienced with monoliths; have just heard the buzzwords Walk away with enough info to research on your own, so will table deep dive questions.
  2. Users want more features, no downtime, and have other options Microservices provides agility and flexibility to application design
  3. Independent services, own data storage, deployed independently
  4. This graphic really clarified microservices for me Monoliths – Tightly integrated, changes have ripple effects to rest of app SOA – Looser coupling, but had to be orchestrated to fit together Microservices – Independently developed and deployed Earlier – Mainframes New – Serverless
  5. Does this apply to you? Technical approaches we’re about to discuss have complexity trade-offs. Like with any architecture, make sure to use right tool for the job
  6. Going straight to microservices is a risk. A lot more technical complexity
  7. What are the boundaries
  8. DDD provides a holistic view of software design. Bounded context is one of its patterns. Small models that support specific operations Quote gets to the heart of what microservices “Delimited applicability”
  9. Group into sets that represent related, specific operations. How micro is micro? Add, Edit as separate services would be a nanoservice. Group by related but specific operations
  10. Independent services, own data storage, deployed independently
  11. As mentioned in earlier slide, if bounded contexts are unknown or you’re not sure ROI there for the technical complexity trade-off, option to start as a monolith and break it down.
  12. Illustrate breaking down monoliths with EF contexts.
  13. Contexts grouped by specific operations/transactions.
  14. As microservices grow, becomes difficult for web and mobile developers to understand how to use them.
  15. Consolidate/orchestrate calls, provide single API call for consumers Good REST design (DX, Developer Experience. API UX for web/mobile developers) API gateway Versioning
  16. Isolated databases Calling other services Duplicated data is ok Event-driven architecture CQRS
  17. Direct DB access creates a tight coupling that loses the benefit of microservices
  18. Have to call out to other services to get “join” data Still gain scale advantages of other endpoints Plus, the other services might be doing their own gets. Slippery slope
  19. Call each service and aggregate the results Also can push aggregation to server, e.g., API Gateway, or inter-service calls
  20. Note the use of messaging, not a tightly coupled replication feature Also an example of CQRS Trade off is more code for pub/sub, but less code on query
  21. Replace the logic that aggregates results to directly calling the materialized view That’s queries, now let’s look at commands (saves)
  22. Switch from SQL to ORM to more easily illustrate transactions Same deal, don’t create tight coupling by saving directly to other service db’s
  23. 2pc not an option (not all db types support it) Event-driven, eventually consistent approach Pros: Consistency across services Cons: More complex, event publishing must be reliable
  24. Use an event store Add only, so faster and no local transaction needed Replay events for current state Services still subscribe Most event stores have snapshots for performance - Eventuate, Cosmos DB change feed Others – transaction log tailing/mining (Linkedin w/ Oracle, AWS)
  25. (depends on your IT setup)  Teams own repos, builds, releases
  26. Demo if time