DEVNET-1142Decomposing Monolithic Applications to Microservices
Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices
-
Upload
amazon-web-services -
Category
Documents
-
view
1.783 -
download
0
Transcript of Real World Development: Peeling The Onion – Migrating A Monolithic Application to Microservices
Adam LarterPrincipal Solutions Architect, Developer Specialist
Real-world developmentPeeling the onion - migrating a
monolithic application to microservices
• 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
A compelling eventSome technical debtBig business opportunity
D E V L O U N G E
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
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
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
D E V L O U N G E
OUR MONOLITH
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
How can we quickly set up anend-to-end DevOps toolchain for our monolith?
D E V L O U N G E
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
Let’s create a CodeStar projectfor our monolith
D E V L O U N G E
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
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
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
• 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
ARCHITECTURE
Single vertically-scaledserver hosted off-cloud
Single vertically-scaledserver hosted off-cloud
D E V L O U N G E
ARCHITECTURE
MONOLITH MONOLITH
D E V L O U N G E
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
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
• 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
• 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
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
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
How does AWS CodeStar help?
D E V L O U N G E
AWS CodePipeline AWS CodeCommit AWS CodeBuildAWS CodeDeployAWS CodeStar
AWS CODE SERVICES
D E V L O U N G E
• 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
Continuous integration
Continuous delivery
Continuous deployment
RELEASE PROCESS LEVELS
Source Build Test Production
Source Build Test Production
AWS CodeCommit
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
Source Build Test Production
AWS CodeBuild
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
Source Build Test Production
Third PartyTooling
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
Source Build Test Production
AWS CodeDeploy
Software Release Steps:AWS CODE SERVICES
D E V L O U N G E
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
Source Build Test Production
Third PartyTooling
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS CodeStar
Software Release Steps:AWS CODE SERVICES
ü 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
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
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
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
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
• 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
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
• 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
Automate N-tier web apps on PaaSAWS ELASTIC BEANSTALK
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
Test customers
WWW WWWPublic ELB
Elastic Load Balancer
Web servers
Security GroupsAuto-scaling &self-healing
D E V L O U N G E
Re-architecting our applicationas serverless microservices
D E V L O U N G E
D E V L O U N G Ehttps://martinfowler.com/articles/microservices.html
D E V L O U N G Ehttps://martinfowler.com/articles/microservices.html
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
• Organized around business capability
• Decentralised ownership of services
• Automated deployment
• Intelligent endpoints
MICROSERVICES CHARACTERISTICS
D E V L O U N G E
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
• 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
• 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
• 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
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
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
Requirements
Quality Deployment
DevelopmentTechnology Stack
Operations
OWNERSHIP – TEAMS CONTROL THEIR DESTINY
D E V L O U N G E
Peeling the onion:How do we identify candidate microservices?
D E V L O U N G E
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
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
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
Serverless microserviceswith AWS Lambda
D E V L O U N G E
• 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
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
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
Let’s create a CodeStar projectfor our first microservice on AWS Lambda
D E V L O U N G E
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
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
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
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
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
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
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
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
“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
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
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
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
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
Strangling the monolith
D E V L O U N G E
BrowserAccountService
UserService
CartService
Common monolithic database
Store FrontUser Interface
STRANGLING THE MONOLITHReducing risk by using a Strangler pattern rather than a direct cut-over
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
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.
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.
BrowserAccountService
UserService
Client
CartService
Common monolithic database
New Microservice
Store FrontUser Interface
ACL
UserMicroservice
CartMicroservice
MOVE ON TO MORE COMPLICATED SERVICES
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
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
Polyglot microservices
D E V L O U N G E
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
Polyglot persistence
D E V L O U N G E
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
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
Let’s do polyglot!
D E V L O U N G E
Orchestrating build and deploywith pipelines
D E V L O U N G E
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
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
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
Source
SourceGitHub
Build
CodeBuildAWS CodeBuild
Deploy
JavaAppElastic Beanstalk
PipelineStage
Action
Transition
CodePipelineMyApplication
D E V L O U N G E
Build
CodeBuildAWS CodeBuild
NotifyDevelopersLambda
Parallel actions
Source
SourceGitHub
CodePipelineMyApplication
Deploy
JavaAppElastic Beanstalk
D E V L O U N G E
Build
CodeBuildAWS CodeBuild
NotifyDevelopersLambda
TestAPIRunscope
Sequential actions
Deploy
JavaAppElastic Beanstalk
Source
SourceGitHub
CodePipelineMyApplication
D E V L O U N G E
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
Debugging and traceability
D E V L O U N G E
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
TravelBuddyUI
FlightsDatabase
FlightService
HotelService
HotelsDatabase
Trips SearchService
TripsDatabase
Web clients Load Balancer API Gateway
MICROSERVICES ARCHITECTURE
Complexity in Code Base
Complexity inInteractions & Deployment
CHALLENGES OF MICROSERVICES
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
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
• 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
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
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
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
user
Amazon API Gateway
AWS Lambda
Amazon DynamoDB
AmazonSQS queue
AWS X-RAY COMPONENTS
D E V L O U N G E
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
1. Add the SDK as a dependency in your build configuration.
AWS X-RAY RECORDER FOR JAVA
pom.xml
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
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
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
AWS X-RAY – INSTRUMENTING YOUR APPLICATION
D E V L O U N G E
Easily Gain Benefits of DevOpsAWS CODESTAR
Reliability
Speed
Scale
Rapid Delivery
Security
Improved Collaboration
D E V L O U N G E
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
• 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
THINK BIGSTART SMALLACT NOW>
HOW DO I START?
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
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
Adam LarterPrincipal Solutions Architect, Developer Specialist
Thank you!