Microservices on AWS Spot instances

37
Microservices on AWS Spot Instances AWS Bay Area Meetup – Jan 13, 2016 Jim Bugwadia; [email protected]

Transcript of Microservices on AWS Spot instances

Page 1: Microservices on AWS Spot instances

Microservices on AWS Spot Instances

AWS Bay Area Meetup – Jan 13, 2016

Jim Bugwadia; [email protected]

Page 2: Microservices on AWS Spot instances

High-performing IT organizations deploy 30X

more frequently with 200X

shorter lead times; they have 60X fewer failures and recover 168X faster.

2015 State of DevOps Report, Puppet Labs

Page 3: Microservices on AWS Spot instances

Confidential 3January 14, 2016

Agenda

• AWS Spot Instances

• Microservices and Containers

• Nirmata

• Demo

Page 4: Microservices on AWS Spot instances

Confidential 4January 14, 2016

About me

• Founder at Nirmata

• Software Developer (C++, Java, Javascript, Go)

• Large-scale distributed systems

Page 5: Microservices on AWS Spot instances

AWS Spot Instances

Page 6: Microservices on AWS Spot instances

Confidential 6January 14, 2016

AWS Buying Options

• On-demand Instances: hourly pricing

• Reserved Instances:• Up to 75% cheaper than on-demand pricing

• 1 – 3 year commitment

• Large upfront costs; typical breakeven at 50-80% utilization

• Spot Instances:• AWS sells excess capacity to higher bidder

• Hourly commitments at a price you name

• Can be up to 90% cheaper that on-demand pricing

• Dedicated Hosts: fully dedicated physical server

Page 7: Microservices on AWS Spot instances

Confidential 7January 14, 2016

How Spot pricing works

• AWS determines market price based on supply and demand

• Instance is allocated to highest bidder

• Bidder pays market price

• Allocated instance is terminated (with a 2 minute warning) when market price increases above your bid price

• Diversification of instance families, instance types, availability zones increases continuity

Page 8: Microservices on AWS Spot instances

Confidential 8January 14, 2016

c3.xlarge, 4 vCPU, 7.5 GiB; on demand price: $0.239 per Hour

Avg ~$0.03x80% of on-demand

Spot Bid Advisor: https://aws.amazon.com/ec2/spot/bid-advisor/

Spot History: https://us-west-1.console.aws.amazon.com/ec2sp/v1/spot/home?region=us-west-1

Page 9: Microservices on AWS Spot instances

Confidential 9January 14, 2016

Spot Fleet

• Simplified bidding across instance types and regions

• Size based on number of instances, vCPU, or your own units

• Include multiple launch specifications, that vary by instance type, AMI, Availability Zone, or subnet

• Select bid strategy: Lowest price or Diversified

• API and Console!

https://console.aws.amazon.com/ec2sp/v1/spot/launch-wizard?region=us-west-1

Page 10: Microservices on AWS Spot instances

Confidential 10January 14, 2016

AWS Spot Instances

Significant savings potential

Spot Instances are identical as On-Demand (no compromises)

But..

• Initial learning curve

• Not suitable for single point of failure applications

• Not suitable for applications coupled to infrastructure

• More complex to operate (without automation)

Page 11: Microservices on AWS Spot instances

Microservices

Page 12: Microservices on AWS Spot instances

Confidential 12January 14, 2016

Page 13: Microservices on AWS Spot instances

Confidential 13January 14, 2016

An initial motivation for

Microservices was scalability

* The Art of Scalability; AKF Scale Cube

Page 14: Microservices on AWS Spot instances

Confidential 14January 14, 2016

X-Axis Scaling

scale by replicating the entire application

Client Load Balancer Application

Application

Application

Page 15: Microservices on AWS Spot instances

Confidential 15January 14, 2016

Y-Axis Scaling

scale by splitting the application into services

Client Load BalancerCustomers

Service

Catalog Service

Orders Service

/catalog

/customers

/orders

Page 16: Microservices on AWS Spot instances

Confidential 16January 14, 2016

Z-Axis Scaling

Client Load BalancerCatalog

Service 3

Catalog Service 1

Catalog Service 3

/catalog [A – I]

/catalog [J – R]

/catalog [S – Z]

scale by splitting the data

Page 17: Microservices on AWS Spot instances

Confidential 17January 14, 2016

Microservices provide Y-X axis scaling

scale by splitting the application and replicating services

Client Load BalancerCustomers

Service

Catalog Service

Orders Service

/catalog

/customers

/orders

Page 18: Microservices on AWS Spot instances

Confidential 18January 14, 2016

Microservices provide Y-X axis scaling

scale by splitting the application and replicating services

Client Load BalancerCustomers

Service

Catalog Service

Orders Service

/catalog

/customers

/ordersBest scalability

Best availability

Best efficiency

Page 19: Microservices on AWS Spot instances

Confidential 19January 14, 2016

1. Elastic: scales up or down independently of other services

2. Resilient: services provide fault isolation boundaries

3. Composable: uniform APIs for each service

4. Minimal: highly cohesive set of entities

5. Complete: loosely coupled with other services

19

A Microservices application is composed of several cooperating but independent services. Each Service is:

http://nirmata.com/2015/02/microservices-five-architectural-constraints/

Page 20: Microservices on AWS Spot instances

Confidential 20January 14, 2016

Microservices Summary

Programming paradigm for the DevOps era

Builds on best practices of modular design and service-orientation

Enables agility at scale (organization, code, users)

But..

• Requires distributed programming, API foundation

• More complex to operate (without automation)

• Requires new tooling

Page 21: Microservices on AWS Spot instances

Application Containers

Page 22: Microservices on AWS Spot instances

Confidential 22January 14, 2016

Containers are great for packaging and managing application components!

Immutable portable application images

Standard units of operations

Separation of Dev-Ops concerns

Efficient runtime

Efficient image management

Page 23: Microservices on AWS Spot instances

Confidential 23January 14, 2016

Container Lifecycle

For a comprehensive CLI reference: http://docs.docker.com/reference/commandline/cli/

Page 24: Microservices on AWS Spot instances

Confidential 24January 14, 2016

Containers

Immediate benefits for any application (portability and agility)

Easy to learn and adopt

Gateway to DevOps

Runtime effeciencies

But..

• Requires separation of config from code (12 factor, etc.)

• Requires new tooling

• More complex to operate (without automation)

Page 25: Microservices on AWS Spot instances

nirmata

Page 26: Microservices on AWS Spot instances

Confidential 26January 14, 2016

DevOps

Public or Private Clouds

Multi-cloud Container Services

nirmata

any cloud – any device

Managed Devices

Data Centers

IT Ops

Page 27: Microservices on AWS Spot instances

Confidential 27January 14, 2016

deploy operate optimize

Turnkey application container lifecycle management

Single control plane across public & private clouds

Highly scalable cloud-native service

Page 28: Microservices on AWS Spot instances

Confidential 28January 14, 2016

Policy Based Orchestration

Real time Analytics

Application Blueprints

DevOps Integrations

Nirmata Control Plane

Host Agent

The Nirmata Solution

Service DB

Service Gateway

Data Plane:• Secure agents• Seamless Service Discovery• Distributed Load-balancing• Programmable routing

Host (or VM)

DNS / LB

Page 29: Microservices on AWS Spot instances

Infrastructure

Container

Policy-based Orchestration

Microservices Infrastructure (optional)

Application Lifecycle Management

Resource Management & Scheduling

Host

Where Nirmata fits

You choose

Page 30: Microservices on AWS Spot instances

Confidential 30January 14, 2016

Nirmata: Key Differentiators

1. Pure play application delivery & management

2. Non-intrusive and easy to use SaaS solution

3. Demand-driven Multi-Layer Scheduling

4. Split plane agent-based architecture

5. Integrated Microservices Infrastructure

6. Integrated monitoring & analytics

Page 31: Microservices on AWS Spot instances

Demo

Page 32: Microservices on AWS Spot instances

Confidential 32January 14, 2016

Demo Steps

1. Configure a AWS Spot Fleet Request

2. Configure a Nirmata Host Group that pools on-demand and spot instances

3. Configure scaling rules, placement rules, and constraints

4. Deploy an application across spot and on-demand instances

5. Terminate spot instances

6. Demonstrate service auto-recovery

7. Demonstrate host auto-scaling

Page 33: Microservices on AWS Spot instances

Confidential 33January 14, 2016

Nirmata continuously monitors and optimizes application availability…

Nirmata Host Groups

Spot On-DemandSpot

1. Host Group Pooling

2. Minimum Placement Constraints

3. Spot Termination Detection

4. Host Auto-Scaling

5. Service Auto-Recovery

6. Dynamic Service Discovery & Load Balancing

Page 34: Microservices on AWS Spot instances

Summary

Page 35: Microservices on AWS Spot instances

Confidential 35January 14, 2016

Internet

Auto Scaling Groups

Edge Tier Mid-Tier Data Tier

Spot Fleet EBS Backed Instances

Auto-Scale Host Group

Spot Fleet Host Group

Launch ConfigHost Group

Page 36: Microservices on AWS Spot instances

Confidential 36January 14, 2016

Key Takeways

1. AWS Spot Instances are significantly cheaper and are always available.

2. With the Microservices approach, each individual service is elastic and resilient.

3. Containers provide fast deployment times, improve utilization, and enable fully automated application operations.

4. Nirmata’s multi-cloud scheduling manages hosts and containers, provides policy-based orchestration, and maintains application availability across Spot and On-Demand instance pools!

Page 37: Microservices on AWS Spot instances

Thank you!

https://try.nirmata.io

test drive Nirmata for free at: