3. The Monolithic Architecture - Antipattern
Difficult to scale
Single point of failure
Not fault-tolerant
Difficult to work across teams,
often slow to iterate on new
functionalities
5. Microservices advocate creating a system
from a collection of small, isolated services,
each of which owns their data,
scalable and resilient to failure
12. Architect to be Serverless Serverless
Fully Managed
• No provisioning
• Zero Administration (
• High-Availability
Developer Productivity
• Focus on the code
• Innovate rapidly
• Reduce time to market
Scalability
• Automatically
• Scale up and down
Up/Down
13. Many Serverless Options on AWS
Serverless
Storage DatabaseNetwork
Compute Content DeliveryMessaging and QueuesSecurity
Gateways
User Management Monitoring & Logging
Internet of Things
Machine Learning
Streaming Analytics
14. 13 Regions
35 Availability Zones
63 Edge Locations
Continuous Expansion
AWS Global Infrastructure
AWS
(As of September, 2016)
15. 13 Regions
35 Availability Zones
63 Edge Locations
Continuous Expansion
AWS Global Infrastructure
AWS
New!
New!
(As of September, 2016)
16. AWS Lambda
Run your code in the cloud, fully
managed and highly-available
Triggered through API calls or state
changes in your setup (S3,
DynamoDB, SNS, Kinesis)
Scales automatically to match the
incoming event rate
Charged per 100ms execution time
Amazon
Kinesis
Amazon Lambda
Amazon
S3
Amazon
DynamoDB
Amazon API
Gateway
Amazon
SNS
17. Amazon S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
CloudFormation
AWS CloudTrail
Amazon
CloudWatch
Amazon SNS
Amazon
SES
Amazon
API Gateway
Amazon
Cognito
AWS
IoT
Amazon
Alexa
Cron events
DATA STORES ENDPOINTS
REPOSITORIES EVENT/MESSAGE SERVICES
Event Sources that integrate with AWS Lambda
(AWS Lambda )
… and the list continues to grow.
Amazon
Config
18. How to build application backends?
Back-end logic DatabaseMobile
19. How to build serverless microservices?
Serverless Microservices
AWS
Lambda
Amazon API
Gateway
Amazon
DynamoDB
Microservice
20. How to build serverless microservices?
Serverless Microservices
AWS
Lambda
Amazon API
Gateway
Amazon
DynamoDB
Microservice 1
Microservice 2
Microservice N
...
21. Amazon API Gateway
Fully managed and scalable RESTful
API gateway service
Powered by our content delivery
network via 63 global edge locations
Provides DDoS protection and
throttling capabilities
Multiple API stages which you define
(e.g. dev, test, prod)
AWS Lambda
Amazon API
Gateway
Amazon EC2
AWS API
On-prem server
22. Amazon API Gateway: Authorization
Amazon API
Gateway
Allows unauthenticated requests, or
authorizes via AWS IAM
Amazon Cognito or AWS STS for
temporary credential generation
API Keys available to monitor
individual app calls
You can create API Key specific
throttling and usage plans
Basic – 5 TPS
Premium – 100 TPS
Power – No throttling
API Keys – Usage Plans
Amazon
Cognito
AWS IAM
23. Webhooks – Integrate with other platforms
Facebook
Page AWS Lambda
Slack
Channel
Amazon API
Gateway
Amazon
DynamoDB
Incoming
Webhook
Oli just posted
on your page!
Oli |
2016-10-01 |
Hello
24. Okasan Online Securities
(岡三オンライン証券株式会社)
“AWS のクラウドネイティブアーキテクチャー
により運用面での作業はほとんど必要なくなり、
コストも従来型のアーキテクチャーと比較して、
7 分の 1 程度にまで削減することができてい
ます。
今のところセキュリティ、実績、コスト、機能の
面で AWS に勝るクラウドベンダーはありませ
ん。 ”
野崎 保 氏
事業戦略担当部長
Online Trading Demo
Platform
Live Stock Market Feed and
Order Management
delivered via Amazon API
Gateway and AWS Lambda
1/7 of cost reduction
26. Storage and Delivery of the App
Amazon S3
Amazon
CloudFront
Amazon S3
• Highly available object storage
• Designed for 99.999999999% durability
• Offers HTTP / HTTPS endpoint to objects
Amazon CloudFront
• Content Delivery Network with 63 edge
locations across the world
• Caches content on edge locations for low
latency
31. MOBILE
CHAT APP
AD DATA ANALYTICS
AND ROUTING
MOBILE APP
ANALYTICS
IMAGE CONTENT
FILTERING
REAL-TIME VIDEO
AD BIDDING
NEWS CONTENT
PROCESSING
GENE SEQUENCE
SEARCH
CLOUD
TELEPHONY
DATA
PROCESSING
WEB
APPLICATIONS
WEB APPLICATIONSTHREAT INTELLIGENCE
AND ANALYTICS
NEWS CONTENT
PROCESSING
GAME METRICS ANALYTICS
Serverless Applications
33. Versioning
Immutable versions of functions
Per version configuration
Per version Cloudwatch metrics
Cloudwatch Logs contain version
attribute
Aliases to “label” a version release
$LATEST contains latest code
41. The Power of Speech: Alexa
Alexa, the voice service that powers
Echo, provides capabilities, or skills,
that enable customers to interact with
devices using voice
Alexa Skills Kit (ASK) allows everyone
to build and publish their own skills
Skills can be powered by AWS Lambda
42. The Power of Speech: Alexa
Node.js SDK available to quickly build new voice skills.
github.com/amzn/alexa-skills-kit-js
var AlexaSkill = require('./AlexaSkill');
var HelloWorld= function () { AlexaSkill.call(this, APP_ID); };
// Extend AlexaSkill
HelloWorld.prototype = Object.create(AlexaSkill.prototype);
HelloWorld.prototype.constructor = HelloWorld;
HelloWorld.prototype.eventHandlers.onLaunch = function (launchRequest, session,
response) {
var speechOutput = ”Hello World”;
response.tell(speechOutput);
};
43. Build your own Alexa Skill!
Amazon
Echo
Alexa Skills
Kit
AWS Lambda Amazon
DynamoDB
(Facebook Page
Post)
44. Final Thoughts
Use Amazon API Gateway to build a front-door to all your
microservices (AWS Lambda, Docker, EC2 etc.)
Use microservices with polyglot persistence to avoid
bottlenecks, schema issues, quick iterations and allow
independent scalability (and caching)
Create many version and stages – no additional charges
for APIs, allows for backwards compatibility
Use serverless interfaces when possible – HTML5 and
JS frameworks like React or Angular are useful