real world development: peeling the onion – migrating a monolithic application to microservices
TRANSCRIPT
![Page 1: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/1.jpg)
Adam LarterPrincipal Solutions Architect, Developer Specialist
Real-world developmentPeeling the onion - migrating a
monolithic application to microservices
![Page 2: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/2.jpg)
• Approaches to taking an enterprise Java monolith and breaking it into microservices on AWS.
• Using the AWS developer tools - AWS CodeStar, AWS CodeCommit, AWS CodePipeline and AWS CodeBuild - to orchestrate and automate our deployment.
• Using AWS Lambda and Amazon API Gateway to hostpolyglot serverless microservices.
• Using AWS X-Ray to capture custom application events, trace requests through the AWS SDKs and analyse underlying service performance.
LEARNING OBJECTIVES
D E V L O U N G E
![Page 3: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/3.jpg)
A compelling eventSome technical debtBig business opportunity
D E V L O U N G E
![Page 4: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/4.jpg)
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
![Page 5: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/5.jpg)
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
XML / JSON data dumps from 3rd party providers
WWW / HTMLend users
![Page 6: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/6.jpg)
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
XML / JSON data dumps from 3rd party providers
XML / JSON REST endpoint for 3rd party integrators
WWW / HTMLend users
![Page 7: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/7.jpg)
D E V L O U N G E
OUR MONOLITH
![Page 8: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/8.jpg)
BUSINESS REQUIREMENTS• Go faster – deliver new features at increased cadence.
Speed wins in business
• Be more stable – no more business interruptions due to technical problems
• Increase quality – all changes and updates to production should work first time, every time
• Be cheaper – reduce TCO
• Business long-term and short-term solution“Let’s move this workload to the cloud”
D E V L O U N G E
![Page 9: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/9.jpg)
How can we quickly set up anend-to-end DevOps toolchain for our monolith?
D E V L O U N G E
![Page 10: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/10.jpg)
Quickly develop, build, and deploy applications on AWS
Start developing on AWS in minutes
Work across your team, securely
Manage software delivery easily
Choose from a variety of project templates
AWS CODESTAR
D E V L O U N G E
![Page 11: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/11.jpg)
Let’s create a CodeStar projectfor our monolith
D E V L O U N G E
![Page 12: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/12.jpg)
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
D E V L O U N G E
Collaborate securely with your team: Manage team access, add team members to projects by role i.e. owners, contributors
Integrated issue tracking and project management: Integrates Atlassian JIRA Software to easily manage issues directly from CodeStar dashboard and monitor application progress and activity
![Page 13: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/13.jpg)
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
D E V L O U N G E
Develop on AWS in minutes: Easily set up your entire development environment and programming tools for coding, building, testing, and deploying on AWS
Supported for popular programming languages: Develop variety of applications using language of choice including Java, NodeJS, JavaScript, PHP, Ruby, Python and now .Net Core
![Page 14: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/14.jpg)
Preconfigured AWS CloudFormation templates for quick development project creation
• Automatic provisioning of underlying AWS services so the team can get coding quickly
Over twenty different AWS CodeStar project templatesSupport for websites, web services, microservices, Alexa Skills dev projects (and more)
3 Hosting environments§ Self-Managed: Amazon EC2 with AWS CodeDeploy§ Managed: Elastic Beanstalk§ Serverless: AWS Lambda
Amazon EC2
AWS CodeDeploy
AWS Elastic Beanstalk
AWSLambda
AWS CODESTAR PROJECT TEMPLATES
D E V L O U N G E
![Page 15: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/15.jpg)
• Single pane of glass to manage your project & build pipeline• Coordinate your day-to-day development activities• Dashboard provides tools to view real time application activity,
monitor builds, and flow of code through deployment pipeline• Customize project dashboard by adding, removing, moving
tiles• Add customizable team wiki tile for team resources sharing or
other purposes (eg. show code snippets)• Use CodeStar project extensions to add tiles and functionality
dashboard
AWS CODESTAR PROJECT DASHBOARD
D E V L O U N G E
![Page 16: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/16.jpg)
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
![Page 17: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/17.jpg)
ARCHITECTURE
MONOLITH MONOLITH
D E V L O U N G E
![Page 18: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/18.jpg)
HIDDEN COMPLEXITY
One Monolith – many components
Cold/Hot Read/Write master
D E V L O U N G E
Single vertically-scaledserver hosted off-cloud
![Page 19: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/19.jpg)
D E V L O U N G E
Underlying Framework
Data Access Service
Single vertically-scaledserver hosted off-cloud
Flight / Hotel / Trip Services
User Experience & Session Manager
HIDDEN COMPLEXITY
![Page 20: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/20.jpg)
• Monolithic codebase• Stateful application logic• Tight coupling• Technical debt• Performance issues• Maintenance difficulties• Implementation detail leakage in the API• Data tier complexities technology and lock-in• Lots of undifferentiated heavy lifting
TECHNICAL CHALLENGES
D E V L O U N G E
![Page 21: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/21.jpg)
• Deploy to AWS Elastic Beanstalk PaaS immediately (lift-and-shift to meet our compelling event deadline)
• Migrate over time to a microservices architecture as were-think and re-imagine our business and technical solution
• Use AWS Lambda to host our microservices as serverless
• Restructure organisation around business capability
• Delegate ownership of each microservice to a dedicated team
TECHNICAL SOLUTION
D E V L O U N G E
![Page 22: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/22.jpg)
Mon
olith
Micr
oser
vices
Monolithicoff-cloud
Elastic Beanstalk
?Identify candidate
microservice, design APIs
CodePipeline
CodeBuild
CodeCommit
CodeStar
Lambda
“Lift
& Sh
ift”
Time D E V L O U N G E
TECHNICAL SOLUTION
API Gateway
Compelling event
![Page 23: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/23.jpg)
Mon
olith
Micr
oser
vices
Monolithicoff-cloud
Elastic Beanstalk
?Identify candidate
microservice, design APIs
CodePipeline
CodeBuild
CodeCommit
CodeStar
Lambda
“Lift
& Sh
ift”
Time D E V L O U N G E
TECHNICAL SOLUTION
API Gateway
Compelling event
![Page 24: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/24.jpg)
How does AWS CodeStar help?
D E V L O U N G E
![Page 25: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/25.jpg)
AWS CodePipeline AWS CodeCommit AWS CodeBuildAWS CodeDeployAWS CodeStar
AWS CODE SERVICES
D E V L O U N G E
![Page 26: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/26.jpg)
• Integration tests with other systems
• Load testing• UI tests• Penetration
testing
Source Build Test Production
• Check-in source code such as .java files.
• Peer review new code
• Compile code• Unit tests• Style checkers • Code metrics• Create
container images
• Deployment to dev, staging, uator production environments
RELEASE PROCESSES HAVE FOUR MAIN PHASES
![Page 27: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/27.jpg)
Continuous integration
Continuous delivery
Continuous deployment
RELEASE PROCESS LEVELS
Source Build Test Production
![Page 28: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/28.jpg)
Source Build Test Production
AWS CodeCommit
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
![Page 29: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/29.jpg)
Source Build Test Production
AWS CodeBuild
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
![Page 30: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/30.jpg)
Source Build Test Production
Third PartyTooling
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
![Page 31: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/31.jpg)
Source Build Test Production
AWS CodeDeploy
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
![Page 32: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/32.jpg)
Source Build Test Production
Third PartyTooling
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
![Page 33: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/33.jpg)
Source Build Test Production
Third PartyTooling
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS CodeStar
Software Release Steps:AWS CODE SERVICES
![Page 34: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/34.jpg)
ü Project Templatesü Team Access Management with
AWS IAMü Managed Build Service with
AWS Code Buildü Unified Project Dashboard using
Amazon CloudWatch monitoring service
ü Issue tracking and project management tool in dashboard via integrated Atlassian JIRA Software
ü AWS CodeCommit for Secure Hosted Git Repository
ü Automated App Deployments with AWS CodeDeploy and AWS CloudFormation
ü Integration of AWS CodePipeline for Automated Continuous Delivery Pipeline
AWS CODESTAR FEATURES
D E V L O U N G E
![Page 35: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/35.jpg)
THE 6 R’s OF MIGRATION
RetainR1 R4
R2 R5
R3 R6
• Keep host/application in source environment• Minimal analysis/validation of scope
& application affinity
Retire • Decommission• No migration of application
Rehost • Like-for-life app migration to AWS• Lift-and-shift approach• Minimal effort to make the app
work ‘on’ the cloud or take advantage of cloudnative services
Replatform • Up-version the OS/DB• Make use of Amazon RDS• Some app changes• App re-installation and clean-up
Refactor • OS/DB porting• Middleware and app changes
to use AWS services natively• Data conversion, DB transition
(eg: MySQL & Aurora)
Rearchitect • Application architecture changes• Using SaaS-based offerings• Porting of application architecture• Data modernisation, application
consolidation, make use of AWS-nativemanaged services
![Page 36: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/36.jpg)
THE 6 R’s OF MIGRATION
RetainR1 R4
R2 R5
R3 R6
• Keep host/application in source environment• Minimal analysis/validation of scope
& application affinity
Retire • Decommission• No migration of application
Rehost • Like-for-life app migration to AWS• Lift-and-shift approach• Minimal effort to make the app
work ‘on’ the cloud or take advantage of cloudnative services
Replatform • Up-version the OS/DB• Make use of Amazon RDS• Some app changes• App re-installation and clean-up
Refactor • OS/DB porting• Middleware and app changes
to use AWS services natively• Data conversion, DB transition
(eg: MySQL & Aurora)
Rearchitect • Application architecture changes• Using SaaS-based offerings• Porting of application architecture• Data modernisation, application
consolidation, make use of AWS-nativemanaged services
ON the cloud
![Page 37: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/37.jpg)
THE 6 R’s OF MIGRATION
RetainR1 R4
R2 R5
R3 R6
• Keep host/application in source environment• Minimal analysis/validation of scope
& application affinity
Retire • Decommission• No migration of application
Rehost • Like-for-life app migration to AWS• Lift-and-shift approach• Minimal effort to make the app
work ‘on’ the cloud or take advantage of cloudnative services
Replatform • Up-version the OS/DB• Make use of Amazon RDS• Some app changes• App re-installation and clean-up
Refactor • OS/DB porting• Middleware and app changes
to use AWS services natively• Data conversion, DB transition
(eg: MySQL & Aurora)
Rearchitect • Application architecture changes• Using SaaS-based offerings• Porting of application architecture• Data modernisation, application
consolidation, make use of AWS-nativemanaged services
IN the cloud
![Page 38: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/38.jpg)
THE 6 R’s OF MIGRATION
RetainR1 R4
R2 R5
R3 R6
• Keep host/application in source environment• Minimal analysis/validation of scope
& application affinity
Retire • Decommission• No migration of application
Rehost • Like-for-life app migration to AWS• Lift-and-shift approach• Minimal effort to make the app
work ‘on’ the cloud or take advantage of cloudnative services
Replatform • Up-version the OS/DB• Make use of Amazon RDS• Some app changes• App re-installation and clean-up
Refactor • OS/DB porting• Middleware and app changes
to use AWS services natively• Data conversion, DB transition
(eg: MySQL & Aurora)
Rearchitect • Application architecture changes• Using SaaS-based offerings• Porting of application architecture• Data modernisation, application
consolidation, make use of AWS-nativemanaged services
FOR the cloud
![Page 39: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/39.jpg)
• Cloud infrastructure introduces new concepts
• Off-cloud design doesn’t always translate to cloud principles
• Lift-and-shift often limits the value proposition but addresses our time constraints for the compelling event
• Applications that don’t embrace cloud-native design don’t fully realize scale, availability, and cost benefits
• Cloud design principles are still emerging, but based on well-known highly scalable application patterns
D E V L O U N G E
THE 6 R’s OF MIGRATION
![Page 40: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/40.jpg)
Mon
olith
Micr
oser
vices
Monolithicoff-cloud
Elastic Beanstalk
?Identify candidate
microservice, design APIs
CodePipeline
CodeBuild
CodeCommit
CodeStar
Lambda
“Lift
& Sh
ift”
D E V L O U N G E
TECHNICAL SOLUTION
API Gateway
Rehost• Like-for-life app migration to AWS• Lift-and-shift approach• Minimal effort to make the app
work ‘on’ the cloud or take advantage of cloudnative services
![Page 41: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/41.jpg)
• Quickly deploy and manage applications in the AWS cloud without worrying about the application infrastructure
• True PaaS – automatically handles allthe details of patching, resource provisioning, load balancing & auto-scaling
• Launch your Java, PHP, .NET, Node.js, Python, and Ruby applications in a matter of minutes
Automate N-tier web apps on PaaSAWS ELASTIC BEANSTALK
D E V L O U N G E
![Page 42: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/42.jpg)
Automate N-tier web apps on PaaSAWS ELASTIC BEANSTALK
![Page 43: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/43.jpg)
192.168.96.0/20
AZ-BAZ-A
Public Subnet 192.168.100.0/24
Public Subnet 192.168.102.0/24
192.168.100.210NAT1 NAT2
WWW WWW
Private Subnet 192.168.104.0/24 Private Subnet 192.168.105.0/24
Private Subnet 192.168.106.0/24 Private Subnet 192.168.107.0/24
192.168.101.10AD DC
1AD DC
2ADFS
Public ELB
AWS Region
D E V L O U N G E
![Page 44: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/44.jpg)
Test customers
WWW WWWPublic ELB
Elastic Load Balancer
Web servers
Security GroupsAuto-scaling &self-healing
D E V L O U N G E
![Page 45: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/45.jpg)
Re-architecting our applicationas serverless microservices
D E V L O U N G E
![Page 46: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/46.jpg)
D E V L O U N G Ehttps://martinfowler.com/articles/microservices.html
![Page 47: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/47.jpg)
D E V L O U N G Ehttps://martinfowler.com/articles/microservices.html
![Page 48: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/48.jpg)
Microservices approach advocates creating a system from a collection of small,
isolated services, each of which owns their data, and is independently isolated, scalable and resilient to failure
D E V L O U N G E
![Page 49: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/49.jpg)
• Organized around business capability
• Decentralised ownership of services
• Automated deployment
• Intelligent endpoints
MICROSERVICES CHARACTERISTICS
D E V L O U N G E
![Page 50: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/50.jpg)
Monolithic Microservices• Simple deployments• Binary failure modes• Inter-module refactoring• Technology monoculture• Vertical scaling• Shared datastore• Owned by everyone
• Partial deployments• Graceful degradation• Strong module boundaries• Technology diversity• Horizontal scaling• Discrete datastores• Owned by single dev or team
D E V L O U N G E
![Page 51: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/51.jpg)
• Increased speed and agility and ability to innovateChanges can be made to the decoupled architecture quickly with low risk
• Reduced costDesigning, implementing and scaling microservices is cost effective because they are decoupled and have no dependencies
• Improved resilienceIf one microservice fails, the entire system will continue to function
MICROSERVICES CHARACTERISTICS
![Page 52: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/52.jpg)
• Be small enough to be re-written in two weeks• Follow DDD bounded contexts• Be run by the team that built them• Own their own state and do not share• Be developed by a team that can be fed by 2 pizzas• Have freedom to use the right technology stack for the job
MICROSERVICES CHARACTERISTICS
![Page 53: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/53.jpg)
• Isn’t it just Service-Oriented Architecture (SOA)?
• How micro is ‘micro’? How many is enough/too many?
• Just like object oriented code -low coupling, highly cohesive, data hidden, encapsulation, defined interface
• Not just a technology change!
MICROSERVICES ARCHITECTURES
D E V L O U N G E
![Page 54: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/54.jpg)
MONOLITHIC ORGANISATION
D E V L O U N G E
Organised on technology capabilities (Conway’s Law)
Web Tier
App Tier
DB
Org
anisa
tiona
l Stru
ctur
e
Appl
icatio
n Ar
chite
ctur
eUI Team
App Logic Team
DBA Team
![Page 55: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/55.jpg)
MICROSERVICES ORGANISATION
D E V L O U N G E
Organised on business initiativesO
rgan
isatio
nal S
truct
ure
Appl
icatio
n Ar
chite
ctur
e
Flight ServiceTeam
TripsServiceTeam
HotelServiceTeam
Web Tier
App Tier
DB
![Page 56: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/56.jpg)
Requirements
Quality Deployment
DevelopmentTechnology Stack
Operations
OWNERSHIP – TEAMS CONTROL THEIR DESTINY
D E V L O U N G E
![Page 57: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/57.jpg)
Peeling the onion:How do we identify candidate microservices?
D E V L O U N G E
![Page 58: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/58.jpg)
Mon
olith
Micr
oser
vices
Monolithicoff-cloud
Elastic Beanstalk
?Identify candidate
microservice, design APIs
CodePipeline
CodeBuild
CodeCommit
CodeStar
Lambda
“Lift
& Sh
ift”
D E V L O U N G E
TECHNICAL SOLUTION
API Gateway
![Page 59: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/59.jpg)
D E V L O U N G E
• Domain-driven design aligns well with the characteristics of microservices – encapsulated, defined-interfaces, isolated
• Microservices should have a well-defined bounded contextand should “just do one thing”
• A bounded context encapsulates a single domain (eg, application service or data model)
• Defines the integration points with other domains
• Beware of creating monolithic microservices!
DDD & BOUNDED CONTEXT
![Page 60: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/60.jpg)
D E V L O U N G E
• Look for ‘seams’ between service classes
• Many of these will own their own DAO and will be well isolated
• Services with CRUD-style interfaces with some related business logic are good candidates
• Look for classes with no or few dependencies
• Try some refactoring to clean up the code before you start
PEELING THE ONION
![Page 61: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/61.jpg)
Serverless microserviceswith AWS Lambda
D E V L O U N G E
![Page 62: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/62.jpg)
• VMs – machine as the unit of scale• “I want to configure machines, storage,
networking, and my OS”
• Containers – application as the unit of scale• “I want to run servers, configure applications,
and control scaling”
• Serverless – functions as the unit of scale• “Run my code when it’s needed”
ECS
EC2
AWS Lambda
CHOOSING COMPUTE INFRASTRUCTURE
D E V L O U N G E
![Page 63: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/63.jpg)
Continuous scaling No servers to manage
Never pay for idle –no cold servers
D E V L O U N G E
AWS LAMBDA FOR MICROSERVICES
![Page 64: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/64.jpg)
Mon
olith
Micr
oser
vices
Monolithicoff-cloud
Elastic Beanstalk
?Identify candidate
microservice, design APIs
CodePipeline
CodeBuild
CodeCommit
CodeStar
Lambda
“Lift
& Sh
ift”
D E V L O U N G E
TECHNICAL SOLUTION
API Gateway
![Page 65: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/65.jpg)
Let’s create a CodeStar projectfor our first microservice on AWS Lambda
D E V L O U N G E
![Page 66: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/66.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 67: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/67.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 68: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/68.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 69: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/69.jpg)
Secure, scalable, and managed git source control
Use standard git tools
Scalability, availability, and durability of Amazon S3
Encryption at rest with customer-specific keys
No repo size limit
Post-commit hooks to call out to SNS/Lambda
AWS CODECOMMIT
D E V L O U N G E
![Page 70: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/70.jpg)
git pull/push CodeCommit
git objects inAmazon S3
git index inAmazon DynamoDB
Encryption keyin AWS KMS
SSH or HTTPS
D E V L O U N G E
AWS CODECOMMIT
![Page 71: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/71.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 72: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/72.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 73: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/73.jpg)
Fully managed build service that compiles source code, runs tests, and produces software packages
Scales continuously and processes multiple builds concurrently
You can provide custom build environments suited to your needs via Docker images
Only pay by the minute for the compute resources you use
CodePipeline and Jenkins integration
D E V L O U N G E
AWS CODEBUILD
![Page 74: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/74.jpg)
“Building” code typically refers to languages that require compiled binaries:• .NET languages: C#, F#, VB.net, etc.• Java and JVM languages: Java, Scala, JRuby• Go
We also refer to the process of creating Docker container images as “building” the image.
EC2
BUILDING YOUR CODE
![Page 75: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/75.jpg)
Many languages don’t require building. These are considered interpreted languages:• PHP• Ruby• Python• Node.js
CodeBuild can package dependencies ready for deployment
EC2
D E V L O U N G E
PACKAGING YOUR CODE
![Page 76: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/76.jpg)
1. Downloads source code
2. Executes commands configured in the buildspec in temporary compute containers (created fresh on every build)
3. Streams the build output logs to the service console and CloudWatch logs
4. Uploads the generated artifact to an S3 bucketD E V L O U N G E
AWS CODEBUILDBuild process
![Page 77: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/77.jpg)
version: 0.1
environment_variables:plaintext:JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:install:commands:- apt-get update -y- apt-get install -y maven
pre_build:commands:- echo Nothing to do in the pre_build phase...
build:commands:- echo Build started on `date`- mvn install
post_build:commands:- echo Build completed on `date`
artifacts:type: zipfiles:- target/messageUtil-1.0.jar
discard-paths: yesD E V L O U N G E
EXAMPLE buildspec.yml
![Page 78: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/78.jpg)
version: 0.1
environment_variables:plaintext:JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:install:commands:- apt-get update -y- apt-get install -y maven
pre_build:commands:- echo Nothing to do in the pre_build phase...
build:commands:- echo Build started on `date`- mvn install
post_build:commands:- echo Build completed on `date`
artifacts:type: zipfiles:- target/messageUtil-1.0.jar
discard-paths: yes
• Variables to be used by phases of build
• Examples for what you can do in the phases of a build:
• You can install packages or run commands to prepare your environment in ”install”.
• Run syntax checking, commands in “pre_build”.
• Execute your build tool/command in “build”
• Test your app further or ship a container image to a repository in post_build
• Create and store an artifact in S3
EXAMPLE buildspec.yml
![Page 79: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/79.jpg)
Strangling the monolith
D E V L O U N G E
![Page 80: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/80.jpg)
BrowserAccountService
UserService
CartService
Common monolithic database
Store FrontUser Interface
STRANGLING THE MONOLITHReducing risk by using a Strangler pattern rather than a direct cut-over
![Page 81: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/81.jpg)
BrowserAccountService
UserService
CartService
Common monolithic database
Store FrontUser Interface
New Microservice
NO MORE NEW FEATURES ON THE MONOLITHReducing risk by using a Strangler pattern rather than a direct cut-over
![Page 82: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/82.jpg)
BrowserAccountService
UserService
CartService
Common monolithic database
New Microservice
Store FrontUser Interface
ACL
ANTI-CORRUPTION LAYER FOR INTEGRATIONIndirection Pattern An ACL is used as a layer of abstraction and indirection between bounded contexts. It translates from one context to the other.
![Page 83: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/83.jpg)
BrowserAccountService
UserService
Client
CartService
Common monolithic database
New Microservice
Store FrontUser Interface
UserMicroservice
START WITH A SIMPLE EXISTING SERVICEIndirection Pattern An ACL is used as a layer of abstraction and indirection between bounded contexts. It translates from one context to the other.
![Page 84: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/84.jpg)
BrowserAccountService
UserService
Client
CartService
Common monolithic database
New Microservice
Store FrontUser Interface
ACL
UserMicroservice
CartMicroservice
MOVE ON TO MORE COMPLICATED SERVICES
![Page 85: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/85.jpg)
Browser
UserMicroservice
AccountMicroservice
AccountService
UserService
Client
ACL
CartService
ACL
Common monolithic database
New Microservice
UserMicroservice
CartMicroservice
AccountMicroservice
Store FrontUser Interface
MOVE ON TO MORE COMPLICATED SERVICES
![Page 86: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/86.jpg)
Browser
UserMicroservice
AccountMicroservice
New Microservice
UserMicroservice
CartMicroservice
AccountMicroservice
Store FrontUser Interface
END STATE
D E V L O U N G E
Next step – UX modernisationto an SPA using Angular/Reactand hosted on S3
![Page 87: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/87.jpg)
Polyglot microservices
D E V L O U N G E
![Page 88: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/88.jpg)
TravelBuddyUI
FlightsDatabase
FlightService
HotelService
HotelsDatabase
Trips SearchService
TripsDatabase
Web clients Load Balancer API Gateway
OWNERSHIP – TEAMS CONTROL THEIR DESTINY
DevelopmentTechnology Stack
D E V L O U N G E
![Page 89: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/89.jpg)
Polyglot persistence
D E V L O U N G E
![Page 90: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/90.jpg)
AmazonElastiCache
Cache
Amazon DynamoDB
NoSQL
Amazon RDS
SQL
Amazon Redshift
AmazonS3
Object
AmazonGlacier
POLYGLOT PERSISTENCE
D E V L O U N G E
ACID Transactions
Fast readsNoSQL
BLOBs High-throughputvolatile cache
![Page 91: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/91.jpg)
HotelSpecials-SvcTripSearch-SvcFlightSpecials-Svc
Amazon ElastiCache
Amazon RDS
Amazon DynamoDB
AmazonRDS
DECENTRALISED DATA STORES
D E V L O U N G E
Scale each independentlyto optimise its scale for performance and cost
![Page 92: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/92.jpg)
Let’s do polyglot!
D E V L O U N G E
![Page 93: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/93.jpg)
Orchestrating build and deploywith pipelines
D E V L O U N G E
![Page 94: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/94.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 95: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/95.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 96: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/96.jpg)
Continuous delivery service for fast and reliable application updates
Model and visualize your software release process
Builds, tests, and deploys your code every time there is a code change
Integrates with third-party tools and AWS
AWS CODEPIPELINE
D E V L O U N G E
![Page 97: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/97.jpg)
Source
SourceGitHub
Build
CodeBuildAWS CodeBuild
Deploy
JavaAppElastic Beanstalk
PipelineStage
Action
Transition
CodePipelineMyApplication
D E V L O U N G E
![Page 98: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/98.jpg)
Build
CodeBuildAWS CodeBuild
NotifyDevelopersLambda
Parallel actions
Source
SourceGitHub
CodePipelineMyApplication
Deploy
JavaAppElastic Beanstalk
D E V L O U N G E
![Page 99: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/99.jpg)
Build
CodeBuildAWS CodeBuild
NotifyDevelopersLambda
TestAPIRunscope
Sequential actions
Deploy
JavaAppElastic Beanstalk
Source
SourceGitHub
CodePipelineMyApplication
D E V L O U N G E
![Page 100: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/100.jpg)
Build
CodeBuildAWS CodeBuild
Staging-Deploy
JavaAppElastic Beanstalk
Prod-Deploy
JavaAppElastic Beanstalk
QATeamReviewManual Approval Manual Approvals
Review
CodePipelineMyApplication
D E V L O U N G E
![Page 101: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/101.jpg)
Debugging and traceability
D E V L O U N G E
![Page 102: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/102.jpg)
MONOLITHIC ARCHITECTURE
D E V L O U N G E
Underlying Framework
Data Access Service
Flights, Trips & Hotels in monolithic database
Flight / Hotel / TripsService
User Experience & Session Manager
Complexity is hiddeninside the monolithic
codebase
![Page 103: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/103.jpg)
TravelBuddyUI
FlightsDatabase
FlightService
HotelService
HotelsDatabase
Trips SearchService
TripsDatabase
Web clients Load Balancer API Gateway
MICROSERVICES ARCHITECTURE
![Page 104: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/104.jpg)
Complexity in Code Base
Complexity inInteractions & Deployment
CHALLENGES OF MICROSERVICES
![Page 105: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/105.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 106: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/106.jpg)
D E V L O U N G E
Team Members
AWS CodeStarAdministrator
Developers commit changes
BuildChanges are built
DeploymentCode is
deployed
MonitoringApplication and infrastructure
IdeasRequestsBug fixes
DevelopersBest practices
Team decisions
ChangesUpdates
Fixes
Creates project and adds users Customer
input
Quickly develop, build, and deploy applications on AWSAWS CODESTAR
![Page 107: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/107.jpg)
• Complex distributed apps are the new normal• Debugging distributed apps is hard• Performance management of microservice-oriented
applications is more work compared to monolithic applications• Tracing across distributed applications is a challenge because:
• Interactions occur across many services• Variations in logging formats – lacking standardisation• Collection, aggregation, and collation of logs from many services
involved in a single interaction is complex
DEBUGGING AND TRACABILITY
D E V L O U N G E
![Page 108: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/108.jpg)
Analyze and debug production, distributed applications
Simple setup: instrument your application with X-Ray SDK and install X-Ray Daemon (already installed for AWS Lambda and Amazon Elastic Beanstalk environments)
End-to-End Tracing, cross-service view of requests made to your application.
AWS X-RAY
D E V L O U N G E
![Page 109: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/109.jpg)
Service Map provides a view of connections between services in your application and aggregated data for each service, including average latency and failure rates
The service provides facilities for custom injection, data annotation, adding metadata and filtering
AWS X-RAY
D E V L O U N G E
![Page 110: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/110.jpg)
Amazon ECS
Amazon EC2
AWS Elastic Beanstalk
AmazonSQS
AmazonSNS
Amazon RDS: Postgres, MySQL, Aurora
AmazonDynamoDB
AWSLambda
AWS X-RAY SERVICE INTEGRATIONS
D E V L O U N G E
![Page 111: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/111.jpg)
user
Amazon API Gateway
AWS Lambda
Amazon DynamoDB
AmazonSQS queue
AWS X-RAY COMPONENTS
D E V L O U N G E
![Page 112: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/112.jpg)
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
![Page 113: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/113.jpg)
1. Add the SDK as a dependency in your build configuration.
AWS X-RAY RECORDER FOR JAVA
pom.xml
![Page 114: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/114.jpg)
2. Add a servlet filter to your deployment descriptor to trace incoming HTTP requests.
AWS X-RAY RECORDER FOR JAVA
web.xml
D E V L O U N G E
![Page 115: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/115.jpg)
3. Configure JDBC interceptor in DataSource bean
AWS X-RAY RECORDER FOR JAVA
servlet-context.xml
D E V L O U N G E
![Page 116: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/116.jpg)
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
![Page 117: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/117.jpg)
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
![Page 118: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/118.jpg)
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
![Page 119: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/119.jpg)
Easily Gain Benefits of DevOpsAWS CODESTAR
Reliability
Speed
Scale
Rapid Delivery
Security
Improved Collaboration
D E V L O U N G E
![Page 120: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/120.jpg)
Programming Languages
Java
JavaScript
Python
Ruby
PHP
.Net Core
IDE/Code Editors
Visual Studio
Eclipse
AWS CLIAWS CLI
CodeStar project templates support popular languages and IDEsAWS CODESTAR
D E V L O U N G E
![Page 121: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/121.jpg)
• Integrates with Atlassian JIRA Software issue tracking and project management tool
• Easy JIRA and AWS CodeStar setupü Log into JIRA and Copy URL from any projectü Enter JIRA URL field in the CodeStar Extensions
• Monitor application activity and manage all JIRA issues in CodeStar dashboard
• Create new JIRA tickets for work items directly dashboard
D E V L O U N G E
AWS CODESTAREasily Gain Benefits of DevOps
![Page 122: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/122.jpg)
THINK BIGSTART SMALLACT NOW>
HOW DO I START?
![Page 123: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/123.jpg)
Learn more about CodeStar:https://aws.amazon.com/codestar
Check out Blog Post: Introducing AWS CodeStar:https://aws.amazon.com/blogs/aws/new-aws-codestar/
Get started with AWS CodeStar:https://console.aws.amazon.com/codestar
REFERENCES
D E V L O U N G E
![Page 124: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/124.jpg)
Learn more about AWS X-Ray:https://aws.amazon.com/x-ray
Check out Blog Post: Introducing AWS CodeStar:https://aws.amazon.com/blogs/aws/category/aws-x-ray/
Get started with AWS CodeStar:https://console.aws.amazon.com/xray/home
REFERENCES
D E V L O U N G E
![Page 125: Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices](https://reader034.vdocument.in/reader034/viewer/2022052117/5a648a237f8b9a46568b4b9f/html5/thumbnails/125.jpg)
Adam LarterPrincipal Solutions Architect, Developer Specialist
Thank you!