Top Banner
Building a cloud service on a cloud infrastructure at Building a cloud service on a cloud infrastructure at Also, cloud. Also, cloud. Mikhail Panchenko, Surge 2011
70

Building a cloud service on a cloud infrastructure. Also, cloud.

Apr 16, 2017

Download

Technology

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: Building a cloud service on a cloud infrastructure. Also, cloud.

Building a cloud service on a cloud infrastructure atBuilding a cloud service on a cloud infrastructure at

Also, cloud.Also, cloud.Mikhail Panchenko, Surge 2011

Page 2: Building a cloud service on a cloud infrastructure. Also, cloud.

Who Am I?Who Am I?

PancakesInfrastructure Engineer at SimpleGeoBackend Engineer at Flickr before thatBackend and Frontend Engineer at Yahoo!Ops/Tools before thatPhilosophy, Economics, and French majorbefore that

@[email protected]

Page 3: Building a cloud service on a cloud infrastructure. Also, cloud.

Tools for mobile/geo developersPrimarily focused on services, some data-oriented APIsPaaS, I guess? I've lost track a bitAvailability, redundancy part of brand

Our outage = your outageNo pressure

Page 4: Building a cloud service on a cloud infrastructure. Also, cloud.

AgendaAgenda

Goals

A little bit of theory

Challenges in The Cloud

General Architecture

Implementation Details

Page 5: Building a cloud service on a cloud infrastructure. Also, cloud.

Architectural GoalsArchitectural Goals

High availability

Linear scalability

Elasticity/Flexibility

Redundancy/Fault Tolerance

Page 6: Building a cloud service on a cloud infrastructure. Also, cloud.

Read: don't wake me up, pleaseRead: don't wake me up, please

Page 7: Building a cloud service on a cloud infrastructure. Also, cloud.

Sound Familiar?Sound Familiar?

Page 8: Building a cloud service on a cloud infrastructure. Also, cloud.

Some Theory, Food for ThoughtSome Theory, Food for Thought

Page 9: Building a cloud service on a cloud infrastructure. Also, cloud.

The Internets as Complex SystemsThe Internets as Complex Systems

Page 10: Building a cloud service on a cloud infrastructure. Also, cloud.

http://www.amazon.com/Normal-Accidents-Living-High-Risk-Technologies/dp/0691004129

Page 11: Building a cloud service on a cloud infrastructure. Also, cloud.

"Complex interactions are those of unfamiliarsequences, or unplanned and unexpectedsequences, and either not visible or not

immediately comprehensible."

Charles Perrow. Normal Accidents: Living with High-Risk Technologies (p. 78). Kindle Edition.

Page 12: Building a cloud service on a cloud infrastructure. Also, cloud.

"The notion of baffling interactions is increasinglyfamiliar to all of us. [...] As systems grow in size andin the number of diverse functions they serve, and

are built to function in ever more hostileenvironments, increasing their ties to other systems,they experience more and more incomprehensible

or unexpected interactions. They become morevulnerable to unavoidable system accidents."

Charles Perrow. Normal Accidents: Living with High-Risk Technologies (p. 72). Kindle Edition.

Page 13: Building a cloud service on a cloud infrastructure. Also, cloud.

Fortunately,Fortunately,This Is Only The InternetThis Is Only The Internet

Page 14: Building a cloud service on a cloud infrastructure. Also, cloud.

"The beauty of this is its simplicity. Once a plangets too complex, everything can go wrong."

Walter Sobchak, The Big Lebowski

Page 15: Building a cloud service on a cloud infrastructure. Also, cloud.

InteractionsInteractionsLinear vs ComplexLinear vs Complex

Page 16: Building a cloud service on a cloud infrastructure. Also, cloud.

CouplingCouplingTight vs LooseTight vs Loose

Page 17: Building a cloud service on a cloud infrastructure. Also, cloud.
Page 18: Building a cloud service on a cloud infrastructure. Also, cloud.

Three Mile IslandThree Mile Island"... they found that radioactive water was not

traveling to the tank they intended, but because ofcomplex flow and pressure interactions, was goingto a different, wrong tank, which also overflowed,

this time in the auxiliary building."

Charles Perrow. Normal Accidents: Living with High-Risk Technologies (pp. 22-23). Kindle Edition.

Page 19: Building a cloud service on a cloud infrastructure. Also, cloud.

Amazon Web ServicesAmazon Web Services"The traffic shift was executed incorrectly and

rather than routing the traffic to the other router onthe primary network, the traffic was routed onto the

lower capacity redundant EBS network."

"Summary of the Amazon EC2 and Amazon RDS Service Disruption in the US East Region"

http://aws.amazon.com/message/65648/

Page 20: Building a cloud service on a cloud infrastructure. Also, cloud.

Common ThemeCommon ThemePreviously independent systems become

coupled as a result of unanticipatedinteractions, leading to fundamentally

surprising results

Page 21: Building a cloud service on a cloud infrastructure. Also, cloud.

When pumping radioactive water into the wrongWhen pumping radioactive water into the wrongtank, the behavior of the program is undefinedtank, the behavior of the program is undefined

Page 22: Building a cloud service on a cloud infrastructure. Also, cloud.

But where does The Cloud come in??But where does The Cloud come in??

Page 23: Building a cloud service on a cloud infrastructure. Also, cloud.

The Trifle AnalogyThe Trifle Analogy

Photo by mathematically_impossible

Page 24: Building a cloud service on a cloud infrastructure. Also, cloud.

The Trifle AnalogyThe Trifle Analogy

Photo by mathematically_impossible

Page 25: Building a cloud service on a cloud infrastructure. Also, cloud.

A complex system consisting of complex subsystemsA complex system consisting of complex subsystems

Page 26: Building a cloud service on a cloud infrastructure. Also, cloud.

Photo by wwarby

Page 27: Building a cloud service on a cloud infrastructure. Also, cloud.

The Trifle AnalogyThe Trifle Analogy

Original photos by mathematically_impossible and miheco

Page 28: Building a cloud service on a cloud infrastructure. Also, cloud.

Tightly coupled to a complex system over which youTightly coupled to a complex system over which youhave no control and into which you have no insighthave no control and into which you have no insight

Page 29: Building a cloud service on a cloud infrastructure. Also, cloud.

Photo by 20after4

Page 30: Building a cloud service on a cloud infrastructure. Also, cloud.

Recall Recall "Baffling Interactions""Baffling Interactions"

Page 31: Building a cloud service on a cloud infrastructure. Also, cloud.

"The notion of baffling interactions is increasinglyfamiliar to all of us. [...] As systems grow in size andin the number of diverse functions they serve, and

are built to function in ever more hostileenvironments, increasing their ties to other

systems, they experience more and moreincomprehensible or unexpected interactions. They

become more vulnerable to unavoidable systemaccidents."

Charles Perrow. Normal Accidents: Living with High-Risk Technologies (p. 72). Kindle Edition.

Page 32: Building a cloud service on a cloud infrastructure. Also, cloud.

DECOUPLE DECOUPLE DECOUPLEDECOUPLE DECOUPLE DECOUPLE( also, simplify )( also, simplify )

Page 33: Building a cloud service on a cloud infrastructure. Also, cloud.

Photo by erikcharlton

Page 34: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple Your SubsystemsDecouple Your Subsystems

Shared resources are the most commonsource of unexpected interaction

Resist temptation to double up on roles

Use queues, caches as buffersNOTE: those are complexsubsystems of their own

Page 35: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple Your SubsystemsDecouple Your SubsystemsExplicit Decoupling

CPU AffinityWebserver on 1-7; SSH etc on 8Crude, but gets the job done

More robust solutions - containers

Page 36: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple Your FunctionalityDecouple Your Functionality

Service architecture

Each service does one thing well

Easier to measure, understand, andaccommodate resource demands

Reduce potential for interactions,cross-functional failure

Page 37: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple from Your Environment with ConfigurationDecouple from Your Environment with ConfigurationManagementManagement

Decouple from your platform (OS/kernel)Easy to test/bench potential candidatesEasy to migrate if you find a winnerThis is especially important when dealing with cloud

Automate as much of deploy/bootstrapprocess as possible

Probably won't help much during a provider outagedue to stampedeBUT: DirectConnectYou might not always be in the cloud..

Page 38: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple Your DatacentersDecouple Your Datacenters

Most robust redundancy mechanism

Hot-hot keeps you on your toes

Simplifies, not just for the cloudYahoo! now foregoing datacenterfeatures like HVAC"If it gets too hot in Washington,turn that DC off for a while"I'm sure they're not the only ones

Page 39: Building a cloud service on a cloud infrastructure. Also, cloud.

Decouple Your DatacentersDecouple Your Datacenters

"AZ" - Basic building block for EC2

This is the level they (theoretically)decouple at

They are probably thinking along thesame lines we are - must be able to turnoff one AZ without impact in the other

Page 40: Building a cloud service on a cloud infrastructure. Also, cloud.

( there's a hidden interaction there )( there's a hidden interaction there )

Page 41: Building a cloud service on a cloud infrastructure. Also, cloud.

Every datacenter as an independent microcosm ofEvery datacenter as an independent microcosm ofyour overall architectureyour overall architecture

Page 42: Building a cloud service on a cloud infrastructure. Also, cloud.

The Birds 'n' the BeesThe Birds 'n' the Bees

Page 43: Building a cloud service on a cloud infrastructure. Also, cloud.

Bird's Eye ViewBird's Eye View

Page 44: Building a cloud service on a cloud infrastructure. Also, cloud.

Photo by reschroederimages

Page 45: Building a cloud service on a cloud infrastructure. Also, cloud.

Bird's Eye ViewBird's Eye View

Page 46: Building a cloud service on a cloud infrastructure. Also, cloud.

( note the absence of specifics )( note the absence of specifics )

Page 47: Building a cloud service on a cloud infrastructure. Also, cloud.

Bird's Eye ViewBird's Eye View

Page 48: Building a cloud service on a cloud infrastructure. Also, cloud.

Maintenance - Divide & ConquerMaintenance - Divide & Conquer

Page 49: Building a cloud service on a cloud infrastructure. Also, cloud.

Local Degradation - Divide & ConquerLocal Degradation - Divide & Conquer

Page 50: Building a cloud service on a cloud infrastructure. Also, cloud.

Incompatible Upgrade - Guess!Incompatible Upgrade - Guess!

Page 51: Building a cloud service on a cloud infrastructure. Also, cloud.

Incompatible Upgrade - Guess!Incompatible Upgrade - Guess!

Page 52: Building a cloud service on a cloud infrastructure. Also, cloud.

Incompatible Upgrade - Yay!Incompatible Upgrade - Yay!

Page 53: Building a cloud service on a cloud infrastructure. Also, cloud.

Baffling Single Node FailureBaffling Single Node Failure

Page 54: Building a cloud service on a cloud infrastructure. Also, cloud.

202 Accepted202 Accepted

Page 55: Building a cloud service on a cloud infrastructure. Also, cloud.

Spike in Write TrafficSpike in Write Traffic

Page 56: Building a cloud service on a cloud infrastructure. Also, cloud.

Really simple operational steps for stressful tasksReally simple operational steps for stressful tasks& situations& situations

Page 57: Building a cloud service on a cloud infrastructure. Also, cloud.

Temporally decouple the problem from theTemporally decouple the problem from theresolutionresolution

Page 58: Building a cloud service on a cloud infrastructure. Also, cloud.

Go back to sleepGo back to sleep

Photo by joshme17

Page 59: Building a cloud service on a cloud infrastructure. Also, cloud.

Now, how about those specifics?Now, how about those specifics?

Page 60: Building a cloud service on a cloud infrastructure. Also, cloud.

Write PathWrite Path

Page 61: Building a cloud service on a cloud infrastructure. Also, cloud.

ELBELB

Dynamic Load Balancing

Flexible virtual IP

Easy to add/remove AZs

Uses healthchecks to automaticallyevict nodes

Page 62: Building a cloud service on a cloud infrastructure. Also, cloud.

Gate - "Layer 8 Proxy"Gate - "Layer 8 Proxy"

Lightweight Node.js daemon

OAuth

Rate Limiting

Basic routing to actual services

Page 63: Building a cloud service on a cloud infrastructure. Also, cloud.

RecallRecall"Decouple Your Functionality""Decouple Your Functionality"

Page 64: Building a cloud service on a cloud infrastructure. Also, cloud.

Services - Pick Your Own AdventureServices - Pick Your Own Adventure

Node.js and PythonSome people just hate Node.js

Can be anything, as long as Gate cantalk to it

( another reason to decouple )

Highly specialized

Page 65: Building a cloud service on a cloud infrastructure. Also, cloud.

RabbitMQRabbitMQ

A grenade for our knife-fight

Very flexible - more than we needSimplification candidate

New persistor in >= 1.3 - degradationover failure

See talk at 1:30PM

Page 66: Building a cloud service on a cloud infrastructure. Also, cloud.

CassandraCassandra

A mostly-textbook DHT

Homogenous distributed model

Random load distribution

Partition toleranceA perfect foundation for ourarchitecture

Page 67: Building a cloud service on a cloud infrastructure. Also, cloud.

Partition TolerancePartition ToleranceIt's not just for outages

Page 68: Building a cloud service on a cloud infrastructure. Also, cloud.

RecallRecall"Divide & Conquer""Divide & Conquer"

Page 69: Building a cloud service on a cloud infrastructure. Also, cloud.

This too is a partitionThis too is a partition

Page 70: Building a cloud service on a cloud infrastructure. Also, cloud.

Thank You!Thank You!

@mihasya

[email protected]