Sie sind auf Seite 1von 52

Modern Application Design:

Building effective services


Shaun Ray
Senior Manager, Developer Evangelism,
AWS

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
1. The Business Case for Modern Applications

2. Architectural Patterns
• Monoliths and microservices
• Event driven systems
• Workflow orchestration and state

3. Operating Model
• Deployment Model
• Choosing the right abstraction
• Distributed Tracing and Monitoring

4. Software Delivery
• Pipelines
• Deployment

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Modern Applications – The Business Case

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The new normal: companies are increasingly global and products
are increasingly digital

47% 79% 67%


of CEOs said they are of CIOs believe that of all business leaders
being challenged by digital business is believe that they must
the board of directors making their IT pick up the pace of
to make progress in organizations better digitalization to
digital business prepared to change remain competitive

Source: Gartner
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
To maintain competitive advantage, digital businesses must
innovate as rapidly as possible

Experiment

Innovation
Flywheel

Ideas Feedback

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS customers are pioneering modern applications

reduced overall compute costs by 95%

cut processing time from 36 hours to 10 seconds

created a stock trade validation system in 3 months

releases over 50+ deployments per hour

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Modern applications

Built on containers Microservices architecture


and serverless and distributed

Each component is See impact of


autonomous and independent isolated errors

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural patterns
What changes
have to be made Operational model
in this new world?
Software delivery

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural Patterns

Monolith Microservices
Does everything Does one thing

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architectural Concerns
Monolith Microservice

Single Artifact Application Code

Datastore

Datastore
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Architecture Choices

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices architectures

APPLICATION
Mobile client

EVENT

API
MICROSERVICE

API
MICROSERVICE

Client

EVENT
MICROSERVICE

API
MICROSERVICE

API
IoT
MICROSERVICE

PERSISTENCE PERSISTENCE

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monoliths and Microservices

API
Gateway
Account Account DB
Mobile client
Lookup

IoT Shipping DB
Shipment
Query

Client
Store Front
Inventory DB
Web App
Inventory
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved. Query
Let’s take a look at the evolution of computing

Physical Servers • Trade CAPEX


Virtual Serversfor Virtual Servers
in Datacenters in Datacenters in the Cloud
OPEX
• Higher utilization • More scale
• Faster provisioning • Elastic resources
speed • Faster speed and
• Improved uptime agility
• Disaster recovery • Reduced
• Hardware maintenance
independence • Better availability
and fault tolerance

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is a container?

Code

Dependencies

Runtime Single, immutable


object

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Evolving to Serverless

Physical Servers Virtual Servers


in Datacenters in the Cloud

Lambda Simple Notification Service

Virtual Servers
in Datacenters
Step Functions

Simple Queue Service API Gateway

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
APIs are the front door of microservices

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Manage APIs with API Gateway

AWS Your VPC

AWS Lambda
API functions Endpoints
Gateway in your
Mobile apps cache VPC

AWS
Endpoints on Lambda
Amazon EC2 function
Websites s

Internet Amazon
CloudFront
All publicly
accessible
endpoints
Services
Regional API Endpoints

Amazon CloudWatch Any other


monitoring AWS service

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Event-driven architectures

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservices messaging patterns

One-Way Request / Response


request

response
Lambda SQS Queue
Lambda SQS Queue
function
function

Return Address Publish / Subscribe


request Service B

Service C
response
SNS
Service A Topic
Lambda SQS Queue Service D
function

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
“I want to “I want to “I want
retry failed tasks” sequence tasks” try/catch/finally”

A A B

“I want to “I want to
select tasks based on data” run tasks in parallel”

A
A B C
B ? C
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Build workflows to orchestrate everything

Track status of data Remove


and execution redundant code

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Simpler integration, less code

With serverless Start With new


polling service integration
Submit Job

Wait X Seconds Start

AWS No
Lambda
Get Job Status Lambda Synchronously Run a Batch Job

function functions
s Job Complete?
Publish Success to SNS Publish Error to SNS

Set Job Failed Set Job Succeeded


End

Sent Message to SNS

End

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cloud-native architectures are small
pieces, loosely joined

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Isn’t all of this very hard now that
we have lots of pieces to operate?

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS operational responsibility models

Less More

On-Premises Cloud

Compute Virtual Machine


EC2 Elastic Beanstalk Fargate AWS Lambda

Databases MySQL MySQL on EC2


RDS MySQL RDS Aurora Aurora Serverless DynamoDB

Storage Storage
S3

Messaging ESBs
Amazon MQ Kinesis SQS / SNS

Analytics
Hadoop Hadoop on EC2 EMR Elasticsearch Service Athena

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is serverless?

No infrastructure provisioning, Automatic scaling


no management

Pay for value Highly available and secure

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
COMPUTE

AWS AWS
Lambda Fargate

DATA STORES

Amazon Amazon Aurora Amazon


S3 Serverless DynamoDB

INTEGRATION

Amazon Amazon Amazon AWS AWS


API Gateway SQS SNS Step Functions AppSync

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Comparison of operational responsibility

AWS manages Customer manages


More opinionated

• Data source integrations • Application code


AWS Lambda • Physical hardware, software, networking,
Serverless functions and facilities
• Provisioning

• Container orchestration, provisioning • Application code


AWS Fargate • Cluster scaling • Data source integrations
Serverless containers • Physical hardware, host OS/kernel, • Security config and updates, network config,
networking, and facilities management tasks

• Container orchestration control plane • Application code


• Data source integrations
ECS/EKS • Physical hardware software,
• Work clusters
Container-management as a service networking, and facilities
• Security config and updates, network config,
firewall, management tasks

• Physical hardware software, • Application code


EC2 networking, and facilities • Data source integrations
Infrastructure-as-a-Service • Scaling
• Security config and updates, network config,
Less opinionated management tasks
• Provisioning, managing scaling and
patching of servers

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Tracing for your modern application

Amazon
DynamoDB

Cloud VPC
On-Premise

AWS
Amazon EC2 Amazon EKS Lambda
Users Amazon Amazon
API Gateway API Gateway
Frontend service Backend service Payments service

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Real life Distributed Tracing

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Troubleshooting SQL queries performance

Created subsegments for data


access layer to capture queries
performance

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Included the SQL call as a metadata of the segment

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SQL performance logs

Build visibility into performance of database calls using X-Ray APIs


<value> <value>

batch-get-traces --trace-ids <trace-ids> Pass trace-ids for SQL calls

Latency (ms) Parameters SQL Command

7.0 @RecID Int 32639064 IF EXISTS (SELECT 1 FROM dbo.Schedule_Detail sd LEFT JOIN dbo.Schedule s on s.Schedule_RecID =
sd.Schedule_RecID . . .
34.8 IF EXISTS (SELECT sr.SR_Location_RecID FROM DBO.SR_LOCATION as sr WHERE
sr.SR_Location_RecID =24) SELECT . . .
1.0 @recid Int 65 SELECT Owner_Level_RecID FROM dbo.User_Defined_Field_Owner_Level WHERE
User_Defined_Field_RecID = @recid
18.6 @serviceRecId Int 11111899 SELECT Company_RecID FROM dbo.SR_Service WHERE SR_Service_RecID = @serviceRecId

123.7 @problemFlag Int 1 . . . exec dbo.usp_getSRDetailTable @problemFlag, @resolutionFlag, @internalAnalysisFlag, @serviceRecID,


@includeChild
1201.8 @problemFlag Int 1 . . . exec dbo.usp_getSRDetailTable @problemFlag, @resolutionFlag, @internalAnalysisFlag, @serviceRecID,
@includeChild

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Entity sync issue

Sending messages
synchronously
….
Still waiting for the
response

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Entity sync resolved

Down to 0.0 ms

Syncing is now taking place on an asynchronous worker threads, no impact on main application
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
By user

Create user annotation from session in the existing segment

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Business impact - Usage analytics

Usage

Annotation.EntityType indicates application modules


% of traces will give you usage metrics by modules within specific time
frame

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Changes to the delivery of software

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How do I develop and deploy code in a
serverless microservices architecture?

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Monolith development lifecycle
developers services

delivery pipelines

build test release monitor

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Microservice development lifecycle
developers services delivery pipelines

build test release monitor

build test release monitor

build test release monitor

build test release monitor

build test release monitor

build test release monitor

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Decompose for agility
(microservices, 2 pizza teams)

Automate everything

Best practices Standardized tools

Belts and suspenders


(governance, templates)

Infrastructure as code

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Developer Tools for CI/CD

AWS CodePipeline

Source Build Test Deploy Monitor

AWS CodeCommit AWS CodeBuild AWS CodeBuild + AWS CodeDeploy AWS X-Ray
Third Party

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How can we best model and provision our infrastructure?

AWS
AWS CodePipeline

cfn-nag
pre-create AWS CodeBuild

Developer AWS create stacks AWS stack


CodeCommit CloudFormation

post-create stack
region
Amazon SNS

stack
deploy Amazon S3 region
region bucket

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Cloud Development Kit

CDK Application
CloudFormatio
n Template
Stack(s)

Construct Construct

Amazon Simple AWS Lambda Amazon S3 Amazon


Queue Service bucket DynamoDB AWS
CloudFormation

Resources

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS customers are pioneering modern applications

reduced overall compute costs by 95%

cut processing time from 36 hours to 10 seconds

created a stock trade validation system in 3 months

releases over 50+ deployments per hour

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Where to learn more

Open Source Distributed Tracing CNCF | opentelemtry.io

Modern Applications by Werner Vogels | allthingsdistributed.com

Modern Application Design AWS | aws.amazon.com/modern-apps

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Conclusion

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Your modern application development journey starts with
AWS Training and Certification

Training
Developing on AWS is where you will learn how to use the AWS AWS Certified DevOps Engineer –
SDK to develop secure and scalable cloud applications. We will Professional
explore how to interact with AWS using code and discuss key DevOps engineers with two or more
concepts, best practices, and troubleshooting tips. years of experience on AWS
This exam tests an engineer’s
AWS Certified Developer – Associate experience provisioning, operating, and
Developers with one or more years of hands-on experience on AWS managing AWS environments.
This exam validates an understanding of core AWS services, uses, Examinees will show an understanding
and basic AWS architecture best practices. Examinees must of how to build highly scalable,
demonstrate proficiency in developing, deploying, and debugging available, and self-healing systems on
cloud-based applications using AWS. the AWS platform and to design,
manage, and maintain tools to
automate operational processes.
Visit https://www.aws.training/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank You for Attending
AWS Online Event: Modern Application Development

We hope you found it interesting! A kind reminder to complete the survey.


Let us know what you thought of today’s event and how we can improve the event experience for
you in the future.

aws-apac-marketing@amazon.com
twitter.com/AWSCloud

facebook.com/AmazonWebServices

youtube.com/user/AmazonWebServices

slideshare.net/AmazonWebServices

twitch.tv/aws

© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

© 2019 Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Das könnte Ihnen auch gefallen