SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
© 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Matt DeBergalis
@debergalis
Cofounder and VP of Product
October 2015
DVO313
Building Next-Generation Applications
with Amazon ECS
What to expect from the session
• Overview of the connected client application architecture, where rich
web + mobile clients maintain persistent network connections to cloud
microservices, and Meteor, a JavaScript application platform for building
these apps.
• Discussion of the unique devops requirements needed to manage
connected client apps and microservices.
• Reasons for delivering Galaxy, Meteor’s cloud runtime, on Amazon ECS.
• Deep dive into our use of Amazon ECS.
Open source
The JavaScript app
platform, for mobile
and web
Open source (MIT)
10th most starred
project on GitHub
Fully supported
Galaxy runtime
Deploy, operate, and
monitor apps and
services
Built on Amazon ECS
Launched to public on
10/5
Team of over 30,
hundreds of OSS
contributors
$30M+ raised from
Andreessen Horowitz,
Matrix, others
100+ development
and training partners
Cloud platform Complete ecosystem
JavaScriptCLRJVM
Meteor: a JavaScript application platform
Galaxy
Proxy
App A (dead) Galaxy Server Galaxy Server
E C S C L U S T E R
E L B
Proxy Scheduler
A Z 1 A Z 2
App A v2
App A v2
App A v2
App A v2
App A (dead)
App A (dead)
App A (dead)
WEBSITES
Links and forms
Page-based
Viewed in a browser
APPS
Modern UI/UX
No refresh button
Browser, mobile, and more
WEBSITES
Stateless
Request / response
Presentation on the wire
APPS
Stateful
Publish / subscribe
Data on the wire
The architecture required for modern
apps is different
Mainframe PC Web
Connected
client
1. Stateful clients and servers with
persistent network connections.
2. Reactive architecture where data
is pushed to clients in real time.
3. Code running on the client and
in the cloud. The app spans the
network.
Connected client
Connected client app
Cloud
Client
Application
microservice
Billing Geo
HTML
Templates
App
Logic
Microservices Database
Reactive UI update system
Native mobile container
Speculative client-side updates
Client-side data store
Custom data sync protocol
Realtime database monitoring
Build & update system
Assemble it yourself
Off the shelf
Build / integrate
Modern app architecture
HTML
Templates
App
Logic
Microservices Database
HTML
Templates
App
Logic
Microservices Database
Reactive UI update system
Native mobile container
Speculative client-side updates
Client-side data store
Custom data sync protocol
Realtime database monitoring
Build & update system
Open-source
JavaScript app platform
Off the shelf
Build / integrate
Assemble it yourself With Meteor
Modern app architecture
JavaScript is the only reasonable
language for cross platform app
development
The architecture required for
modern apps is different
The devops required for
modern apps is different
The devops required for
modern apps is more complex
• Persistent, stateful connections.
• Seamless application updates –
“hot code push”.
• Client tracking and metrics.
• Complex array of microservices.
• Mobile considerations (builds, push
notifications).
Connected client devops
• Scalable multi-tenant: 100k users,
1MM processes, 100M sessions.
• Accessible to developers without
sophisticated devops background.
• Suitable for expert teams and complex
apps.
• High availability of user apps and the
Galaxy infrastructure.
• Online updates of all Galaxy components.
• Smooth path to customer-managed cloud.
• Use off-the-shelf parts wherever possible.
Design requirements
C o n n e c t e d c l i e n t m a n a g e m e n t
Application logic and services
MetricsHot code deploySession mgmt
Container management
IaaS resources
Web
Galaxy: connected client management
I n f r a s t r u c t u r e
Mobile Device
• O(100k) independent user processes that need isolation.
• Granular, efficient – essential in multi-tenant.
• Surprisingly important: fast spin-up.
• Speed and responsiveness is an essential part of a great
developer experience.
• Fast spin-up lets us build around a “single-shot” container
model.
• Layering as a path to user-supplied binaries.
Containers and orchestration
• Lots of exciting options here: ECS, Kubernetes, Marathon, …
• Service argument is compelling. Same case we make for Galaxy to
our customers.
• Integration with other parts of AWS saves us time and code.
Example: services automatically register containers with Elastic Load
Balancing (ELB).
• Support for multiple Availability Zones.
• Bottom line: ECS got us to market faster than the alternatives.
ECS container management
Implementation
Logs
Metrics
Galaxy UI
App
images
App
state
Cluster 1
Manager
app app
app app
Cluster 2
app app
app app
Cluster 3
app app
app app
Developer Admin
Manager
Manager
F R O N T E N D B A C K E N D
Galaxy
E C S C L U S T E R
A Z 1 A Z 2
App AApp A App AApp A
Galaxy
E C S C L U S T E R
E L B
A Z 1 A Z 2
App AApp A App AApp A
Proxy Proxy
Galaxy
E C S C L U S T E R
E L B
A Z 1 A Z 2
App AApp A App AApp A
App CService BService B
Proxy SchedulerProxy SchedulerProxy
Galaxy
Proxy
E C S C L U S T E R
E L B
Proxy
A Z 1 A Z 2
App AApp A App AApp A
Scheduler
App CService BService B
Galaxy UI Galaxy UI
Deeper Dive
Custom scheduler
Connected client proxy
User metrics
• Need fine-grained control over how individual tasks are allocated to
container instances and across Availability Zones.
• Container health depends on high-level behavior of app processes, not
just low-level checks.
• Need rate limits and backoff policy when restarting application
containers. (Not our code; potentially not the same policy for all users.)
• Users need visibility into container health.
• Need to ensure that system-essential containers (proxy, Galaxy UI) can
be scheduled even if resources are over-committed.
Scheduling containers
ECS default scheduler not designed to do these kinds of things.
That’s okay! Instead, ECS provides cluster state and task
management APIs needed to write our own. ~1,500 lines of Go.
• High availability app containers must be
distributed across Availability Zones.
• App containers should be evenly
distributed across instances in an
Availability Zone.
• Container instances should be roughly
equally loaded.
• Each container instance must have
space to run a proxy and a scheduler.
Also implements rate-limiting, application health checks, and
coordinated version updates.
Writing a custom scheduler
Logs
Metrics
Galaxy UI
App
images
App
state
Cluster 1
Scheduler
app app
app app
Cluster 2
app app
app app
Cluster 3
app app
app app
Developer Admin
Scheduler
Scheduler
F R O N T E N D B A C K E N D
State sync
policies
scheduler
ECS
APIApp state
Desired config
<app,version,containers,HA>
StartTask
StopTask
ListTasks
DescribeTasks
Actual config
[<container status,exit code>]
State sync
• To ensure the scheduler stays alive, we create an ECS service
calling for exactly 1 scheduler task.
• If the scheduler goes down, crashed containers will no longer be
restarted, and users won't be able to launch new containers or stop
old ones. Reasonable failure mode.
• We’re considering changing to a “keep <n> running” model,
using Amazon DynamoDB to broker a leadership election between
the set.
Scheduling the scheduler
• Manages the persisent connection between clients and
the appropriate application backend / microservice process.
• Implements stable sessions + coordinated version updates.
• Share nothing architecture. Any proxy can serve any request.
• High availability: multiple proxies in multiple Availability Zones.
• Scheduled as an ECS service; binds to ELB.
Connected client proxy
Proxy
App A Galaxy ServerApp A App A App A Galaxy Server
E C S C l u s t e r
E L B
Proxy
App B App C App D
Scheduler
ELB routes traffic to any proxy. Any proxy can route to any app container.
ELB routes traffic on ports 80 and 443. The ELB is configured in TCP pass-through mode so that we can use
WebSockets.
A Z 1 A Z 2
Stable sessions
Proxy
App A Galaxy ServerApp A App A App A Galaxy Server
E C S C l u s t e r
E L B
Proxy
App B App C App D
Scheduler
A Z 1 A Z 2
Proxy routes initial request to random container, and applies a cookie to the client with the ID of the selected container.
On subsequent connections (XHR or interrupted WebSocket), proxy uses cookie to determine backend.
Stable sessions
Proxy
Galaxy ServerApp A App A App A Galaxy Server
E C S C l u s t e r
E L B
Proxy
App B App C App D
Scheduler
A Z 1 A Z 2
If desired backend is unavailable, proxy selects new backend and reapplies a cookie.
App A (dead)
App A
Stable sessions
Proxy
App A v1 Galaxy Server
App A v1
App A v1
App A v1
Galaxy Server
E C S C l u s t e r
E L B
Proxy Scheduler
A Z 1 A Z 2
v1
App updates require the cooperation of the scheduler and proxy components.
Coordinated version updates
Proxy
App A v1 Galaxy Server
App A v1
App A v1
App A v1
Galaxy Server
E C S C l u s t e r
E L B
Proxy Scheduler
A Z 1 A Z 2
App A v2
App A v2
App A v2
App A v2
v1
First step is to spin up new containers in parallel with the old.
(This can be done in a rolling fashion, not shown here.)
Coordinated version updates
Proxy
App A (dead) Galaxy Server Galaxy Server
E C S C l u s t e r
E L B
Proxy Scheduler
A Z 1 A Z 2
App A v2
App A v2
App A v2
App A v2
App A (dead)
App A v1
App A v1
v1
Once new containers pass health checks, scheduler starts to tear down old client connections and the old
containers.
Coordinated version updates
Proxy
App A (dead) Galaxy Server Galaxy Server
E C S C l u s t e r
E L B
Proxy Scheduler
A Z 1 A Z 2
App A v2
App A v2
App A v2
App A v2
App A (dead)
App A (dead)
App A (dead)
v1 v2
Proxy recognizes code update in progress, ignores session cookie, and routes client to new container
(establishing new stable session).
Coordinated version updates
• Galaxy collects metrics on CPU, memory, network traffic,
and a count of connected clients from each running app.
• collector process (one per container instance) streams container
metrics via Docker Remote API, and poll proxy metrics on a known
port.
• aggregator process (singleton) polls each collector, computes
aggregate rollups (hourly, daily), stores each time series in
DynamoDB.
• Aggregator expires old metrics. Tables are sharded by time range.
• Galaxy server reads directly from DynamoDB.
Metrics
With the amount of growth we have seen after our launch last year, keeping
the servers alive has been an uphill battle until Galaxy came along.
– Tigran Sloyan, Codefights
Galaxy … solved many of the ongoing challenges we had with our previous
server stack: load balancing across sticky sessions, scaling processes, etc.
– Shawn Young, Classcraft
Loosely coupled architecture working well for us
High availability strategy works: apps stayed up during IaaS outages
Our experience so far
Multiple clusters
Additional AWS regions
On-prem (customer-supplied IAM credentials)
Free tier and instance cost optimizations
… and more …
What’s next
The JavaScript app platform
www.meteor.com
Galaxy available now!
Thank you!
Matt DeBergalis – @debergalis
Remember to complete
your evaluations!

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
 Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar... Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
Improving Infrastructure Governance on AWS by Henrik Johansson, Solutions Ar...
 
Running Microservices on Amazon ECS - AWS April 2016 Webinar Series
Running Microservices on Amazon ECS - AWS April 2016 Webinar SeriesRunning Microservices on Amazon ECS - AWS April 2016 Webinar Series
Running Microservices on Amazon ECS - AWS April 2016 Webinar Series
 
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
Running Microservices and Docker on AWS Elastic Beanstalk - August 2016 Month...
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
 
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
AWS re:Invent 2016: Chalk Talk: Succeeding at Infrastructure-as-Code (GPSCT312)
 
Scheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECSScheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECS
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
 
From Monolith to Microservices
From Monolith to MicroservicesFrom Monolith to Microservices
From Monolith to Microservices
 
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
Automating Software Deployments with AWS CodeDeploy by Matthew Trescot, Manag...
 
Continuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECS Continuous Delivery to Amazon ECS
Continuous Delivery to Amazon ECS
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
使用 AWS 負載平衡服務讓您的應用程式規模化
使用 AWS 負載平衡服務讓您的應用程式規模化使用 AWS 負載平衡服務讓您的應用程式規模化
使用 AWS 負載平衡服務讓您的應用程式規模化
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
AWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWSAWS January 2016 Webinar Series - Introduction to Docker on AWS
AWS January 2016 Webinar Series - Introduction to Docker on AWS
 
DevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless ArchitectureDevOps, Microservices and Serverless Architecture
DevOps, Microservices and Serverless Architecture
 
Releasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePiplineReleasing Software Quickly and Reliably with AWS CodePipline
Releasing Software Quickly and Reliably with AWS CodePipline
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
Running Microservices and Docker with AWS Elastic Beanstalk
Running Microservices and Docker with AWS Elastic BeanstalkRunning Microservices and Docker with AWS Elastic Beanstalk
Running Microservices and Docker with AWS Elastic Beanstalk
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 

Andere mochten auch

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
Amazon Web Services
 
Theory of architecture
Theory of architectureTheory of architecture
Theory of architecture
Krishna Jhawar
 
Sex And The Samurai Done4
Sex And The Samurai Done4Sex And The Samurai Done4
Sex And The Samurai Done4
Demonassassin88
 

Andere mochten auch (19)

(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
 
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
(DVO315) Log, Monitor and Analyze your IT with Amazon CloudWatch
 
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWSAWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
AWS January 2016 Webinar Series - Introduction to Deploying Applications on AWS
 
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
(DVO201) Scaling Your Web Applications with AWS Elastic Beanstalk
 
(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood(DVO301) AWS OpsWorks Under the Hood
(DVO301) AWS OpsWorks Under the Hood
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
Principle of architecture
Principle of architecturePrinciple of architecture
Principle of architecture
 
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as CodeAWS January 2016 Webinar Series - Managing your Infrastructure as Code
AWS January 2016 Webinar Series - Managing your Infrastructure as Code
 
(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS(DVO401) Deep Dive into Blue/Green Deployments on AWS
(DVO401) Deep Dive into Blue/Green Deployments on AWS
 
From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...
 
Theory of architecture
Theory of architectureTheory of architecture
Theory of architecture
 
Designing Narrative Content Workshop
Designing Narrative Content WorkshopDesigning Narrative Content Workshop
Designing Narrative Content Workshop
 
Comete
CometeComete
Comete
 
clase ungs
clase ungsclase ungs
clase ungs
 
Sex And The Samurai Done4
Sex And The Samurai Done4Sex And The Samurai Done4
Sex And The Samurai Done4
 
Workstyles e Netstyles Sostenibili e Competitivi
Workstyles e Netstyles Sostenibili e CompetitiviWorkstyles e Netstyles Sostenibili e Competitivi
Workstyles e Netstyles Sostenibili e Competitivi
 
Frattali
FrattaliFrattali
Frattali
 

Ähnlich wie (DVO313) Building Next-Generation Applications with Amazon ECS

Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
Amazon Web Services
 

Ähnlich wie (DVO313) Building Next-Generation Applications with Amazon ECS (20)

Azure Container Apps
Azure Container Apps Azure Container Apps
Azure Container Apps
 
E301 Elastic Beanstalk PaaS
E301 Elastic Beanstalk PaaSE301 Elastic Beanstalk PaaS
E301 Elastic Beanstalk PaaS
 
Load Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & KubernetesLoad Balancing in the Cloud using Nginx & Kubernetes
Load Balancing in the Cloud using Nginx & Kubernetes
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Exploring the continuum between Cordova and React Native
Exploring the continuum between Cordova and React NativeExploring the continuum between Cordova and React Native
Exploring the continuum between Cordova and React Native
 
Building-Modern-Distributed-Applications
Building-Modern-Distributed-ApplicationsBuilding-Modern-Distributed-Applications
Building-Modern-Distributed-Applications
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
 
Deep Dive on Microservices and Amazon ECS by Raul Frias, Solutions Architect,...
Deep Dive on Microservices and Amazon ECS by Raul Frias, Solutions Architect,...Deep Dive on Microservices and Amazon ECS by Raul Frias, Solutions Architect,...
Deep Dive on Microservices and Amazon ECS by Raul Frias, Solutions Architect,...
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
 
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
 
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
2022-05-23-DevOps pro Europe - Managing Apps at scale.pdf
 
Advanced Container Scheduling
Advanced Container SchedulingAdvanced Container Scheduling
Advanced Container Scheduling
 
Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17Modern application development with oracle cloud sangam17
Modern application development with oracle cloud sangam17
 
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
Azure Day Rome 2019 Reloaded - Strangle(r pattern) your legacy application ru...
 
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
AWS re:Invent 2016: Operations Automation and Infrastructure Management with ...
 
Build a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million UsersBuild a Website on AWS for Your First 10 Million Users
Build a Website on AWS for Your First 10 Million Users
 
Day in the life event-driven workshop
Day in the life  event-driven workshopDay in the life  event-driven workshop
Day in the life event-driven workshop
 
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
Modern Cloud-Native Streaming Platforms: Event Streaming Microservices with K...
 
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
Managing Your Application Lifecycle on AWS: Continuous Integration and Deploy...
 
Build an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million UsersBuild an App on AWS for Your First 10 Million Users
Build an App on AWS for Your First 10 Million Users
 

Mehr von Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

(DVO313) Building Next-Generation Applications with Amazon ECS

  • 1. © 2015, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Matt DeBergalis @debergalis Cofounder and VP of Product October 2015 DVO313 Building Next-Generation Applications with Amazon ECS
  • 2. What to expect from the session • Overview of the connected client application architecture, where rich web + mobile clients maintain persistent network connections to cloud microservices, and Meteor, a JavaScript application platform for building these apps. • Discussion of the unique devops requirements needed to manage connected client apps and microservices. • Reasons for delivering Galaxy, Meteor’s cloud runtime, on Amazon ECS. • Deep dive into our use of Amazon ECS.
  • 3. Open source The JavaScript app platform, for mobile and web Open source (MIT) 10th most starred project on GitHub Fully supported Galaxy runtime Deploy, operate, and monitor apps and services Built on Amazon ECS Launched to public on 10/5 Team of over 30, hundreds of OSS contributors $30M+ raised from Andreessen Horowitz, Matrix, others 100+ development and training partners Cloud platform Complete ecosystem
  • 5. Galaxy Proxy App A (dead) Galaxy Server Galaxy Server E C S C L U S T E R E L B Proxy Scheduler A Z 1 A Z 2 App A v2 App A v2 App A v2 App A v2 App A (dead) App A (dead) App A (dead)
  • 6. WEBSITES Links and forms Page-based Viewed in a browser APPS Modern UI/UX No refresh button Browser, mobile, and more
  • 7. WEBSITES Stateless Request / response Presentation on the wire APPS Stateful Publish / subscribe Data on the wire
  • 8. The architecture required for modern apps is different
  • 10. 1. Stateful clients and servers with persistent network connections. 2. Reactive architecture where data is pushed to clients in real time. 3. Code running on the client and in the cloud. The app spans the network. Connected client
  • 12. HTML Templates App Logic Microservices Database Reactive UI update system Native mobile container Speculative client-side updates Client-side data store Custom data sync protocol Realtime database monitoring Build & update system Assemble it yourself Off the shelf Build / integrate Modern app architecture
  • 13. HTML Templates App Logic Microservices Database HTML Templates App Logic Microservices Database Reactive UI update system Native mobile container Speculative client-side updates Client-side data store Custom data sync protocol Realtime database monitoring Build & update system Open-source JavaScript app platform Off the shelf Build / integrate Assemble it yourself With Meteor Modern app architecture
  • 14. JavaScript is the only reasonable language for cross platform app development
  • 15. The architecture required for modern apps is different
  • 16. The devops required for modern apps is different
  • 17. The devops required for modern apps is more complex
  • 18. • Persistent, stateful connections. • Seamless application updates – “hot code push”. • Client tracking and metrics. • Complex array of microservices. • Mobile considerations (builds, push notifications). Connected client devops
  • 19. • Scalable multi-tenant: 100k users, 1MM processes, 100M sessions. • Accessible to developers without sophisticated devops background. • Suitable for expert teams and complex apps. • High availability of user apps and the Galaxy infrastructure. • Online updates of all Galaxy components. • Smooth path to customer-managed cloud. • Use off-the-shelf parts wherever possible. Design requirements
  • 20. C o n n e c t e d c l i e n t m a n a g e m e n t Application logic and services MetricsHot code deploySession mgmt Container management IaaS resources Web Galaxy: connected client management I n f r a s t r u c t u r e Mobile Device
  • 21. • O(100k) independent user processes that need isolation. • Granular, efficient – essential in multi-tenant. • Surprisingly important: fast spin-up. • Speed and responsiveness is an essential part of a great developer experience. • Fast spin-up lets us build around a “single-shot” container model. • Layering as a path to user-supplied binaries. Containers and orchestration
  • 22. • Lots of exciting options here: ECS, Kubernetes, Marathon, … • Service argument is compelling. Same case we make for Galaxy to our customers. • Integration with other parts of AWS saves us time and code. Example: services automatically register containers with Elastic Load Balancing (ELB). • Support for multiple Availability Zones. • Bottom line: ECS got us to market faster than the alternatives. ECS container management
  • 24. Logs Metrics Galaxy UI App images App state Cluster 1 Manager app app app app Cluster 2 app app app app Cluster 3 app app app app Developer Admin Manager Manager F R O N T E N D B A C K E N D
  • 25. Galaxy E C S C L U S T E R A Z 1 A Z 2 App AApp A App AApp A
  • 26. Galaxy E C S C L U S T E R E L B A Z 1 A Z 2 App AApp A App AApp A Proxy Proxy
  • 27. Galaxy E C S C L U S T E R E L B A Z 1 A Z 2 App AApp A App AApp A App CService BService B Proxy SchedulerProxy SchedulerProxy
  • 28. Galaxy Proxy E C S C L U S T E R E L B Proxy A Z 1 A Z 2 App AApp A App AApp A Scheduler App CService BService B Galaxy UI Galaxy UI
  • 29. Deeper Dive Custom scheduler Connected client proxy User metrics
  • 30. • Need fine-grained control over how individual tasks are allocated to container instances and across Availability Zones. • Container health depends on high-level behavior of app processes, not just low-level checks. • Need rate limits and backoff policy when restarting application containers. (Not our code; potentially not the same policy for all users.) • Users need visibility into container health. • Need to ensure that system-essential containers (proxy, Galaxy UI) can be scheduled even if resources are over-committed. Scheduling containers
  • 31. ECS default scheduler not designed to do these kinds of things. That’s okay! Instead, ECS provides cluster state and task management APIs needed to write our own. ~1,500 lines of Go. • High availability app containers must be distributed across Availability Zones. • App containers should be evenly distributed across instances in an Availability Zone. • Container instances should be roughly equally loaded. • Each container instance must have space to run a proxy and a scheduler. Also implements rate-limiting, application health checks, and coordinated version updates. Writing a custom scheduler
  • 32. Logs Metrics Galaxy UI App images App state Cluster 1 Scheduler app app app app Cluster 2 app app app app Cluster 3 app app app app Developer Admin Scheduler Scheduler F R O N T E N D B A C K E N D State sync
  • 34. • To ensure the scheduler stays alive, we create an ECS service calling for exactly 1 scheduler task. • If the scheduler goes down, crashed containers will no longer be restarted, and users won't be able to launch new containers or stop old ones. Reasonable failure mode. • We’re considering changing to a “keep <n> running” model, using Amazon DynamoDB to broker a leadership election between the set. Scheduling the scheduler
  • 35. • Manages the persisent connection between clients and the appropriate application backend / microservice process. • Implements stable sessions + coordinated version updates. • Share nothing architecture. Any proxy can serve any request. • High availability: multiple proxies in multiple Availability Zones. • Scheduled as an ECS service; binds to ELB. Connected client proxy
  • 36. Proxy App A Galaxy ServerApp A App A App A Galaxy Server E C S C l u s t e r E L B Proxy App B App C App D Scheduler ELB routes traffic to any proxy. Any proxy can route to any app container. ELB routes traffic on ports 80 and 443. The ELB is configured in TCP pass-through mode so that we can use WebSockets. A Z 1 A Z 2 Stable sessions
  • 37. Proxy App A Galaxy ServerApp A App A App A Galaxy Server E C S C l u s t e r E L B Proxy App B App C App D Scheduler A Z 1 A Z 2 Proxy routes initial request to random container, and applies a cookie to the client with the ID of the selected container. On subsequent connections (XHR or interrupted WebSocket), proxy uses cookie to determine backend. Stable sessions
  • 38. Proxy Galaxy ServerApp A App A App A Galaxy Server E C S C l u s t e r E L B Proxy App B App C App D Scheduler A Z 1 A Z 2 If desired backend is unavailable, proxy selects new backend and reapplies a cookie. App A (dead) App A Stable sessions
  • 39. Proxy App A v1 Galaxy Server App A v1 App A v1 App A v1 Galaxy Server E C S C l u s t e r E L B Proxy Scheduler A Z 1 A Z 2 v1 App updates require the cooperation of the scheduler and proxy components. Coordinated version updates
  • 40. Proxy App A v1 Galaxy Server App A v1 App A v1 App A v1 Galaxy Server E C S C l u s t e r E L B Proxy Scheduler A Z 1 A Z 2 App A v2 App A v2 App A v2 App A v2 v1 First step is to spin up new containers in parallel with the old. (This can be done in a rolling fashion, not shown here.) Coordinated version updates
  • 41. Proxy App A (dead) Galaxy Server Galaxy Server E C S C l u s t e r E L B Proxy Scheduler A Z 1 A Z 2 App A v2 App A v2 App A v2 App A v2 App A (dead) App A v1 App A v1 v1 Once new containers pass health checks, scheduler starts to tear down old client connections and the old containers. Coordinated version updates
  • 42. Proxy App A (dead) Galaxy Server Galaxy Server E C S C l u s t e r E L B Proxy Scheduler A Z 1 A Z 2 App A v2 App A v2 App A v2 App A v2 App A (dead) App A (dead) App A (dead) v1 v2 Proxy recognizes code update in progress, ignores session cookie, and routes client to new container (establishing new stable session). Coordinated version updates
  • 43. • Galaxy collects metrics on CPU, memory, network traffic, and a count of connected clients from each running app. • collector process (one per container instance) streams container metrics via Docker Remote API, and poll proxy metrics on a known port. • aggregator process (singleton) polls each collector, computes aggregate rollups (hourly, daily), stores each time series in DynamoDB. • Aggregator expires old metrics. Tables are sharded by time range. • Galaxy server reads directly from DynamoDB. Metrics
  • 44. With the amount of growth we have seen after our launch last year, keeping the servers alive has been an uphill battle until Galaxy came along. – Tigran Sloyan, Codefights Galaxy … solved many of the ongoing challenges we had with our previous server stack: load balancing across sticky sessions, scaling processes, etc. – Shawn Young, Classcraft Loosely coupled architecture working well for us High availability strategy works: apps stayed up during IaaS outages Our experience so far
  • 45. Multiple clusters Additional AWS regions On-prem (customer-supplied IAM credentials) Free tier and instance cost optimizations … and more … What’s next
  • 46. The JavaScript app platform www.meteor.com Galaxy available now!
  • 47. Thank you! Matt DeBergalis – @debergalis