Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery...

61
Learn Adopt Innovate #lai

Transcript of Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery...

Page 1: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Learn Adopt

Innovate #lai

Page 2: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.
Page 3: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservice Architectures

Danilo Poccia ‒ AWS Technical Evangelist@danilop

Page 4: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Why Microservices?

Page 5: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

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

Page 6: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

As a Project scales Complexity arises

“Complexity arises when the dependencies among the elements

become important.”

Complex Adaptive Systems: An Introduction to Computational Models of Social Life

Scott E. Page, John H. Miller

Page 7: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Business Domain+

Loosely Coupled +

Bounded Context

Page 8: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservices

Independent Deployment

Page 9: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Single Responsibility Principle

“Gather together those things that change for the same reason, and

separate those things that change for different reasons.”

Robert C. Martin

Page 10: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservices

Choose the Right Tool

Page 11: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservices

Adopt New Technologies

Page 12: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservices

Culture of Automation

Page 13: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Adrian Cockcroft, Technology Fellow at Battery Ventures http://www.slideshare.net/adriancockcroft/goto-berlin

Page 14: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

# Services > # Developers

Page 15: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

How small is small?

Page 16: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Gall’s law

“A complex system that works is invariably found to have evolved from a simple system that worked.

A complex system designed from scratch never works and cannot be patched up to make it work.

You have to start over with a working simple system.”

Systemantics: How Systems Really Work and How They Fail, John Gall,1975

Page 17: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

“something that could be rewritten in two weeks”

Page 18: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Two Pizza Teams

Page 19: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Conway’s law

“organizations which design systems ... are constrained to produce designs which

are copies of the communication structures of these organizations”

Melvin Conway, 1968

Page 20: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Architecture

Dev

Ops

Microse

rvice

s

Page 21: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Feature Teams

Page 22: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Internal Open Source

Page 23: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

SynchronousVs

Asynchronous

Page 24: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

OrchestrationVs

Choreography

Page 25: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Distributed Systems

Independent ScalabilityAuto Scaling

Page 26: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Distributed Systems

Eventual ConsistencyIdempotent Operations

Page 27: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Robustness Principle / Postel's law

“be conservative in what you do,be liberal in what you accept

from others”

(form an early TCP specification)

Page 28: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Security

Least Privileges

Single Sign-On

Confused Deputy Problem (downstream calls

after authentication)

Page 29: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Testing

Automate

Service Tests

End-to-end Tests

Synthetic Transactions

Page 30: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Monitoring

Correlation ID

Standard Log format

Expose Service Metrics

From Log collection to Near Real-Time Event routing

Amazon CloudWatch Logs Amazon Kinesis

Understand your trends

Page 31: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Discovery

Self-Describing System

Amazon Route 53 (DNS)

AWS Resource Tagging

Amazon CloudWatch Events

Page 32: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Deployment Pipeline

Page 33: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Developer

Developer

Developer

Developer

Developer

Build

Stage #1 Stage #2 … Stage #N Production

Build Build Build Build

Page 34: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Developer

Developer

Developer

Developer

Developer

Build

Stage #1 Stage #2 … Stage #N Production

Build Build Build Build

Bug!

Page 35: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Developer

Developer

Developer

Developer

Developer

Build

Stage #1 Stage #2 … Stage #N Production

Build Build Build Build

Build Build Build Build Build

Build Build Build Build Build

Page 36: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Developer

Developer

Developer

Developer

Developer

Build

Stage #1 Stage #2 … Stage #N Production

Build Build Build Build

Bug!

Build Build Build Build Build

Build Build Build Build Build

Page 37: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Design for Failure

Degrade Functionality

Page 38: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

"Jtecul" by own - Own work. Licensed under CC BY-SA 3.0 via Wikimedia Commons

http://commons.wikimedia.org/wiki/File:Jtecul.jpg#/media/File:Jtecul.jpg

CircuitBreakers

Page 39: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Amazon Route 53 Private DNS in VPC

Elastic / Application Load Balancing

CircuitBreakers Health

Checks

Page 40: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Migration from Legacy Monolith?

Look for the right “seam”

Page 41: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Disposable Infrastructure

Immutable Deployments

Page 42: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Why Docker?

Page 43: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

VM Container

Page 44: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Amazon EC2 Container Service

A highly scalable, high performance container management service

Manage containers at any scale

Launch and terminate containers to clusters of instances on EC2

Run specific tasks or long-living services

Page 45: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

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

Page 46: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Case

Studies

Page 47: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Why AWS Lambda?

Page 48: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

AWS Lambda

Event driven,fully managed compute

Page 49: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Amazon EC2 Containers AWS LambdaOn-Premises

Weeks Minutes Seconds Milliseconds

Page 50: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Netflix Architecture

Page 51: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Netflix Architecture

Asgard, Amimator, Hystrix, Eureka, Cassandra, JVM,

Docker, …

On AWS

Page 52: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.
Page 53: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Hailo Architecture

Page 54: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Hailo Architecture

Hubot, Janky, Jenkins, Go, RabbitMQ, Cassandra,

Docker, …

On AWS

Page 55: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.
Page 56: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Sample Architecture

Page 57: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Sample Architecture

Content Management System Prototype

On AWS

Page 58: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Lambda Function

S3 Bucket#1

S3 Bucket#2

DynamoDBTable

ECSTask

ECSCluster

Images +

Medatada

UploadEvent

Notification

Thumbnail

Write Metadata

Run

Schedule

Read Metadata

Write “index.html”

1

2

3

Page 59: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

CloudFront Distribution

Edge Location

User S3 Bucket#1

S3 Bucket#2

Page 60: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Iterate Continous Improvement

Kaizen

Page 61: Learn Adopt Innovate - Amazon Web Services · Amazon Kinesis Understand your trends. Discovery Self-Describing System Amazon Route 53 (DNS) ... Event driven, fully managed compute.

Microservice Architectures

Danilo Poccia ‒ AWS Technical Evangelist@danilop