Top Banner
Microservice Architecture on Amazon Web Services Alex Sinner Solutions Architect, Amazon Web Services @alexsinner
38

Aws microservice keynote

Aug 12, 2015

Download

Documents

nextbuild
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Aws microservice keynote

Microservice Architecture on Amazon Web Services

Alex Sinner Solutions Architect, Amazon Web Services

@alexsinner

Page 2: Aws microservice keynote

Why Microservices?

Page 3: Aws microservice keynote

http://en.wikipedia.org/wiki/Multitier_architecture

Page 4: Aws microservice keynote

As a Project scales Complexity arises

Page 5: Aws microservice keynote

How to design smaller services?

Page 6: Aws microservice keynote

Monolithic application vs Microservices

http://martinfowler.com/articles/microservices.html

Page 7: Aws microservice keynote
Page 8: Aws microservice keynote

Business Domain!+

Loosely Coupled +

Bounded Context

Page 9: Aws microservice keynote

Microservices

Independent Deployment!

Page 10: Aws microservice keynote

Microservices

Choose the Right Tools!

Page 11: Aws microservice keynote

Microservices

Adopt New Technologies!

Page 12: Aws microservice keynote

Microservices

Culture of Automation!

Page 13: Aws microservice keynote

How small is small?

Page 14: Aws microservice keynote

“something that could be rewritten in two weeks”

Page 15: Aws microservice keynote

Two Pizza Teams!

Page 16: Aws microservice keynote

Architecture

Dev

Ops

Page 17: Aws microservice keynote

Containers & event-driven computing

Page 18: Aws microservice keynote

Virtual Machine! Container!

Page 19: Aws microservice keynote

Docker on AWS!

Amazon!Linux!!!

A supported and maintained Linux

image provided by Amazon Web Services!

!

Amazon EC2 Container Service!

!Highly scalable, high

performance container management service!

!!

AWS!Elastic

Beanstalk!!

For deploying and scaling web

applications and services!

!

Page 20: Aws microservice keynote

Amazon EC2 Container Service!

Key Components

Clusters!Container Instances!

Tasks Task Definitions Task Scheduler

Regional Resource pool Grouping of Container Instances Start empty, dynamically scalable

Page 21: Aws microservice keynote

Amazon EC2 Container Service!

Key Components

Clusters Container Instances!

Tasks Task Definitions Task Scheduler

Amazon EC2 instances Docker daemon Amazon ECS agent

Page 22: Aws microservice keynote

https://github.com/aws/amazon-ecs-agent

Page 23: Aws microservice keynote

Amazon EC2 Container Service!

Key Components

Container Instances Clusters Tasks

Task Definitions Task Scheduler

Unit of work Grouping of related Containers Run on Container Instances

Page 24: Aws microservice keynote

Amazon EC2 Container Service!

Key Components

Container Instances Clusters

Tasks Task Definitions!Task Scheduler!

[ { "image": "mysql", "name": "db", "cpu": 10, "memory": 500, …

Page 25: Aws microservice keynote

Tasks are defined via Task Definitions

[! {! "image": "tutum/wordpress-stackable",! "name": "wordpress",! "cpu": 10,! "memory": 500,! "essential": true,! "links": [! "db"! ],! "entryPoint": [! "/bin/sh",! "-c"! ],! "environment": [! …! ],! "portMappings": [! {! "containerPort": 80,! "hostPort": 80! }! ]! },! !

! {! "image": "mysql",! "name": "db",! "cpu": 10,! "memory": 500,! "essential": true,! "entryPoint": [! "/entrypoint.sh"! ],! "environment": [! {! "name": "MYSQL_ROOT_PASSWORD",! "value": "pass"! }! ],! "portMappings": []! }!]!

Page 26: Aws microservice keynote

[! {! "image": "tutum/wordpress-stackable",! "name": "wordpress",! "cpu": 10,! "memory": 500,! "essential": true,! "links": [! "db"! ],! "entryPoint": [! "/bin/sh",! "-c"! ],! "environment": [! …! ],! "portMappings": [! {! "containerPort": 80,! "hostPort": 80! }! ]! },! ]!

! {! "image": "mysql",! "name": "db",! "cpu": 10,! "memory": 500,! "essential": true,! "entryPoint": [! "/entrypoint.sh"! ],! "environment": [! {! "name": "MYSQL_ROOT_PASSWORD",! "value": "pass"! }! ],! "portMappings": []! }!]!

From Docker Hub

10 CPU Units (1024 is full CPU), 500 Megabytes of Memory

Environment Variables

No external ports exposed

Tasks are defined via Task Definitions

Page 27: Aws microservice keynote

[! {! "image": "tutum/wordpress-stackable",! "name": "wordpress",! "cpu": 10,! "memory": 500,! "essential": true,! "links": [! "db"! ],! "entryPoint": [! "/bin/sh",! "-c"! ],! "environment": [! …! ],! "portMappings": [! {! "containerPort": 80,! "hostPort": 80! }! ]! },! !

[! {! "image": "mysql",! "name": "db",! "cpu": 10,! "memory": 500,! "essential": true,! "entryPoint": [! "/entrypoint.sh"! ],! "environment": [! {! "name": "MYSQL_ROOT_PASSWORD",! "value": "pass"! }! ],! "portMappings": []! }!]!

Essential to our Task Docker link to mysql container

Expose port 80 in container to port 80 on host

Tasks are defined via Task Definitions

Page 28: Aws microservice keynote

Amazon EC2 Container Service!

Key Components

Container Instances Clusters

Tasks Task Definitions Task Scheduler

Long-running services RunTask for batch jobs Integrate with 3rd party schedulers

Page 29: Aws microservice keynote

AWS Lambda!!

Zero Admin!Event-driven

Compute Platform!

Page 30: Aws microservice keynote

AWS Lambda!!

Focus on business logic,!not infrastructure!

Customer uploads code, AWS Lambda handles:

Capacity Scaling

Deployment Fault tolerance

Monitoring Logging

. . .

Page 31: Aws microservice keynote

AWS Lambda

Automatic scaling

Customers pay only for what they use,

no over/under provisioning

Page 32: Aws microservice keynote

AWS Lambda

Fine-grained pricing

Price compute time by 100ms, even short jobs make sense

Low request charge No hourly, daily, or monthly minimums

Free tier

Page 33: Aws microservice keynote

Events come in many different shapes & sizes

S3 event notifications

DynamoDB Streams

Kinesis events Custom events

Page 34: Aws microservice keynote

AWS Lambda

Asynchronous Invocation Synchronous Invocation

AWS Lambda

Event RequestResponse

Response Response

CloudWatch Logs

vs

Page 35: Aws microservice keynote

Mobile & IoT

AWS Lambda Backends!

Page 36: Aws microservice keynote

Amazon EC2 Containers AWS Lambda On-Premises

Weeks Minutes Seconds Milliseconds

Infrastructure Scaling

Page 37: Aws microservice keynote

Amazon EC2 Containers AWS Lambda On-Premises

Low High Higher Highest

Infrastructure Utilization

Page 38: Aws microservice keynote

Thank You!

@alexsinner