SlideShare a Scribd company logo
Being ElasticEvolving Programming for the CloudRandy ShoupeBay Chief EngineerQCon San FranciscoNovember 4, 2010
Cloud is a New EcosystemResource-RichInexpensiveAvailableElasticManagedRemoteVirtualVariableEphemeralMetered
The Old and the Newflickr.com/photos/slapbcn/2035854990/
Developers Must AdaptBenefits are hugeConstraints are realAdapt to the constraints to get the benefitsMost adaptations force otherwise good development practices (!)
Scaling for the CloudTo leverage scalable infrastructure, you needScalable applicationScalable development practicesScalable culturePrinciples and practices discussed widely (particularly at QCon!)Convergence of Architecture, Agile, DevOps, etc.
Universal Scalability LawThroughput limited by two factorsContention (α):  queueing on shared resourceCoherency (β):  communication and coordination among multiple nodesFormulated by Neil GuntherGeneralization of Amdahl’s LawGrounded in real-world physical processeshttp://www.perfdynamics.com/Manifesto/USLscalability.html
Programming in the CloudParallelismLayeringServicesState managementData modelFailure handlingTesting
ParallelismThink parallel!Simple parallel algorithm out-scales “smarter” non-parallel algorithmExploiting elasticity fundamentally requires parallelismRequest processingParallelism through Routing requestsAggregating servicesQueueing workAsync I/O and Futures are your friendsflickr.com/photos/sharif/2423144088/
ParallelismOffline computationParallelism through Workload partitioningPartitioning data and processingE.g., pipelines, MapReduceflickr.com/photos/sharif/2423144088/“There are 3 rules to follow when parallelizing large codes.  Unfortunately, no one knows what these rules are.” – W. Somerset Maugham and Gary Montry
LayeringStrictly layered systemEach software layer handles a single set of responsibilitiesCloud makes this particularly importantCommon code in frameworksConfigurationInstrumentationFailure management“All problems in computer science can be solved by another level of indirection … Except for the problem of too many layers of indirection.” – David Wheeler
ServicesDecompose system functionality into servicesSimpleSingle-purposeModularStatelessMulti-instanceCompose complex application behavior from simple elements“Make everything as simple as possible, but not simpler.” – Albert Einstein
ServicesThe service should be the fundamental unit of …CompositionCombine simple services into complex systemsDependencyDepend on a service interface, not implementationAddressingTalk to logical endpoint (URI), not IP:portPersistenceAbstract and isolate persistence within a serviceDeployment
State ManagementStateless instancesInstances are ephemeralMemory / storage is fast and local, but transient and inconsistent Equivalent to a cacheDurable state in persistent storage(Many implementations)“Here today, gone tomorrow.” – American proverb
Key-Value Data ModelDistributed key-value storesSimpleHorizontally scalable(Many implementations)Constrained by designCannot express complex relationshipsLimited schemaPredictable, bounded performanceGreater burden on applicationJoins, aggregations, sorts, etc.Integrity and schema validation
Key-Value Data ModelPlan to ShardPartition by keyParallelize writes for write throughputParallelize reads for read throughputPlan to DenormalizeOptimize for readsPrecalculate joins, aggregations, sortsUse async queue to updateLearn to tolerate transient inconsistency
Failure HandlingExpect failures and handle theme.printStackTrace() does not count!Failure handling meansGraceful degradationTimeouts and retriesThrottling and back-offAbstract through frameworks and policiesflickr.com/photos/davidwatts1978/3199405401/“Hope is not a strategy.” – Various
TestingTest early and oftenTest-driven and Test-first approaches work particularly well in the cloudAutomated testing works particularly wellIncremental development and deploymentTest end-to-endMuch easier to test at loadMore challenging to simulate all combinations and failure modes“In the data center, robust code is best practice.  In the cloud, it is essential.” – Adrian Cockcroft
Operating in the CloudDevOps MindsetConfiguration InjectionInstrumentationMonitoringMetering
DevOps MindsetIn the Cloud, Developers  OpsEveryone will use tools for deployment, monitoring, etc.Manageability as an investmentManagement interfaces need as much engineering discipline as functional interfacesAutomate, automate, automateRepeatable builds and deploymentsProvisioning, scaling, failure management, etc.If you do it more than twice, script it
Configuration InjectionBoot instance from bare minimum packageExternalize all variabilitySeparate code and configurationConfiguration should driveInstance roleService and resource dependenciesBehavior / capabilities InjectAt boot timeAt runtimeflickr.com/photos/andresrueda/2983149263/“I do my work at the same time each day – the last minute.” – Unknown
InstrumentationFully instrument all componentsCannot attach debugger / profilerRemotely diagnose, profile, debugAvoid “monitoring fatigue”Logging is insufficientNeeds to be automatically interpretable and actionableUse a frameworkMake part of your infrastructureflickr.com/photos/wwarby/3016549999/
MonitoringMonitor requests end-to-endTrace all requests as they flow from component to componentMonitor component activity and performanceMetrics, metrics, metricsUnderstand your typical system behaviorSpiky, flat, sinusoidal?Know the baseline so you know what is abnormalflickr.com/photos/pdstahl/3884421899/
MeteringFixed cost -> variable costProcessingStorageNetworkEfficiency mattersAny savings goes directly to the bottom lineAny inefficiency is multiplied by many instances (!)“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.” – Donald Knuth
Evolving for the Cloud“It is not the strongest of the species that survives, nor the most intelligent that survives. It is the one that is the most adaptable to change.” – Charles Darwin

More Related Content

What's hot (20)

PDF
Software Architecture
Yoav Avrahami
 
PPTX
Service Architectures at Scale
Randy Shoup
 
PPTX
Effective Microservices In a Data-centric World
Randy Shoup
 
PPTX
DevOps is not a Culture. It is about responsibility
Yoav Avrahami
 
PDF
devops, microservices, and platforms, oh my!
Andrew Shafer
 
PPTX
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
Randy Shoup
 
PDF
Turning Human Capital into High Performance Organizational Capital
John Willis
 
PDF
Immutable Service Delivery Shenzhen 2016
John Willis
 
PDF
Dockercon USA 2016 - Immutable Awesomeness
John Willis
 
PDF
Micro Service – The New Architecture Paradigm
Eberhard Wolff
 
PDF
[WSO2Con EU 2017] Darwin Ate My App
WSO2
 
PPTX
Embracing Failure - Fault Injection and Service Resilience at Netflix
Josh Evans
 
PPTX
Top 5 Java Performance Metrics, Tips & Tricks
AppDynamics
 
PDF
Microservices: The Best Practices
Pavel Mička
 
PPTX
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf
 
PDF
Architecting for Enterprise with JavaScript
Kurtis Kemple
 
PPT
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
Niall Roche
 
PDF
Continuous Delivery and Micro Services - A Symbiosis
Eberhard Wolff
 
PDF
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DevOps Enterprise Summmit
 
PPTX
Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Josh Evans
 
Software Architecture
Yoav Avrahami
 
Service Architectures at Scale
Randy Shoup
 
Effective Microservices In a Data-centric World
Randy Shoup
 
DevOps is not a Culture. It is about responsibility
Yoav Avrahami
 
devops, microservices, and platforms, oh my!
Andrew Shafer
 
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
Randy Shoup
 
Turning Human Capital into High Performance Organizational Capital
John Willis
 
Immutable Service Delivery Shenzhen 2016
John Willis
 
Dockercon USA 2016 - Immutable Awesomeness
John Willis
 
Micro Service – The New Architecture Paradigm
Eberhard Wolff
 
[WSO2Con EU 2017] Darwin Ate My App
WSO2
 
Embracing Failure - Fault Injection and Service Resilience at Netflix
Josh Evans
 
Top 5 Java Performance Metrics, Tips & Tricks
AppDynamics
 
Microservices: The Best Practices
Pavel Mička
 
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf
 
Architecting for Enterprise with JavaScript
Kurtis Kemple
 
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
Niall Roche
 
Continuous Delivery and Micro Services - A Symbiosis
Eberhard Wolff
 
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DevOps Enterprise Summmit
 
Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Josh Evans
 

Viewers also liked (7)

PPT
Teaching Machines to Fish -- How eBay Improves Itself
Randy Shoup
 
PPTX
Flowcon2013 - Virtuous Cycles of Velocity: What I Learned About Going Fast at...
Randy Shoup
 
PPTX
Why Enterprises Are Embracing the Cloud
Randy Shoup
 
PPTX
A CTO's Guide to Scaling Organizations
Randy Shoup
 
PPTX
The Importance of Culture: Building and Sustaining Effective Engineering Org...
Randy Shoup
 
PPT
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
Randy Shoup
 
PPTX
Minimum Viable Architecture -- Good Enough is Good Enough in a Startup
Randy Shoup
 
Teaching Machines to Fish -- How eBay Improves Itself
Randy Shoup
 
Flowcon2013 - Virtuous Cycles of Velocity: What I Learned About Going Fast at...
Randy Shoup
 
Why Enterprises Are Embracing the Cloud
Randy Shoup
 
A CTO's Guide to Scaling Organizations
Randy Shoup
 
The Importance of Culture: Building and Sustaining Effective Engineering Org...
Randy Shoup
 
The eBay Architecture: Striking a Balance between Site Stability, Feature Ve...
Randy Shoup
 
Minimum Viable Architecture -- Good Enough is Good Enough in a Startup
Randy Shoup
 
Ad

Similar to Being Elastic -- Evolving Programming for the Cloud (20)

PDF
An agile approach to cloud infrastructure
Richard Seroter
 
PPTX
Designing distributed systems
Malisa Ncube
 
PPTX
Building Cloud Ready Apps
VMware Tanzu
 
ODP
Best practice adoption (and lack there of)
John Pape
 
PDF
Linux Assignment 3
Diane Allen
 
PPTX
Microservices architecture
Faren faren
 
PDF
12-Factor App
Abdullah Çetin ÇAVDAR
 
PDF
Azure and cloud design patterns
Venkatesh Narayanan
 
PPTX
Microservices with .Net - NDC Sydney, 2016
Richard Banks
 
PPT
SW Architecture Monolithic to SOA
Raman Kannan
 
PPTX
Life & Work of Butler Lampson | Turing100@Persistent
Persistent Systems Ltd.
 
PDF
Gluecon Monitoring Microservices and Containers: A Challenge
Adrian Cockcroft
 
PPTX
Hello cloud 5
Gireesh Kumar
 
PPTX
Scalable service architectures @ BWS16
Zoltán Németh
 
PDF
Deconstructing Monoliths with Domain Driven Design
VMware Tanzu
 
PPT
Netkit
dambatbul
 
PDF
Proactive ops for container orchestration environments
Docker, Inc.
 
PPT
Debs 2011 tutorial on non functional properties of event processing
Opher Etzion
 
PPTX
Why Cloud Management Makes Sense
RightScale
 
PDF
Distributed Systems in Data Engineering
Oluwasegun Matthew
 
An agile approach to cloud infrastructure
Richard Seroter
 
Designing distributed systems
Malisa Ncube
 
Building Cloud Ready Apps
VMware Tanzu
 
Best practice adoption (and lack there of)
John Pape
 
Linux Assignment 3
Diane Allen
 
Microservices architecture
Faren faren
 
Azure and cloud design patterns
Venkatesh Narayanan
 
Microservices with .Net - NDC Sydney, 2016
Richard Banks
 
SW Architecture Monolithic to SOA
Raman Kannan
 
Life & Work of Butler Lampson | Turing100@Persistent
Persistent Systems Ltd.
 
Gluecon Monitoring Microservices and Containers: A Challenge
Adrian Cockcroft
 
Hello cloud 5
Gireesh Kumar
 
Scalable service architectures @ BWS16
Zoltán Németh
 
Deconstructing Monoliths with Domain Driven Design
VMware Tanzu
 
Netkit
dambatbul
 
Proactive ops for container orchestration environments
Docker, Inc.
 
Debs 2011 tutorial on non functional properties of event processing
Opher Etzion
 
Why Cloud Management Makes Sense
RightScale
 
Distributed Systems in Data Engineering
Oluwasegun Matthew
 
Ad

More from Randy Shoup (17)

PDF
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Randy Shoup
 
PPTX
Anatomy of Three Incidents -- Commonalities and Lessons
Randy Shoup
 
PPTX
One Terrible Day at Google, and How It Made Us Better
Randy Shoup
 
PPTX
Scaling Your Architecture for the Long Term
Randy Shoup
 
PPTX
Minimal Viable Architecture - Silicon Slopes 2020
Randy Shoup
 
PPTX
An Agile Approach to Machine Learning
Randy Shoup
 
PPTX
Moving Fast at Scale
Randy Shoup
 
PPTX
Breaking Codes, Designing Jets, and Building Teams
Randy Shoup
 
PPTX
Scaling Your Architecture with Services and Events
Randy Shoup
 
PPTX
Learning from Learnings: Anatomy of Three Incidents
Randy Shoup
 
PPTX
Minimum Viable Architecture - Good Enough is Good Enough
Randy Shoup
 
PPTX
Managing Data at Scale - Microservices and Events
Randy Shoup
 
PPTX
Moving Fast At Scale
Randy Shoup
 
PPTX
DevOps - It's About How We Work
Randy Shoup
 
PPTX
Ten Lessons of the DevOps Transition
Randy Shoup
 
PPTX
Managing Data in Microservices
Randy Shoup
 
PPTX
QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...
Randy Shoup
 
Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Randy Shoup
 
Anatomy of Three Incidents -- Commonalities and Lessons
Randy Shoup
 
One Terrible Day at Google, and How It Made Us Better
Randy Shoup
 
Scaling Your Architecture for the Long Term
Randy Shoup
 
Minimal Viable Architecture - Silicon Slopes 2020
Randy Shoup
 
An Agile Approach to Machine Learning
Randy Shoup
 
Moving Fast at Scale
Randy Shoup
 
Breaking Codes, Designing Jets, and Building Teams
Randy Shoup
 
Scaling Your Architecture with Services and Events
Randy Shoup
 
Learning from Learnings: Anatomy of Three Incidents
Randy Shoup
 
Minimum Viable Architecture - Good Enough is Good Enough
Randy Shoup
 
Managing Data at Scale - Microservices and Events
Randy Shoup
 
Moving Fast At Scale
Randy Shoup
 
DevOps - It's About How We Work
Randy Shoup
 
Ten Lessons of the DevOps Transition
Randy Shoup
 
Managing Data in Microservices
Randy Shoup
 
QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...
Randy Shoup
 

Being Elastic -- Evolving Programming for the Cloud

  • 1. Being ElasticEvolving Programming for the CloudRandy ShoupeBay Chief EngineerQCon San FranciscoNovember 4, 2010
  • 2. Cloud is a New EcosystemResource-RichInexpensiveAvailableElasticManagedRemoteVirtualVariableEphemeralMetered
  • 3. The Old and the Newflickr.com/photos/slapbcn/2035854990/
  • 4. Developers Must AdaptBenefits are hugeConstraints are realAdapt to the constraints to get the benefitsMost adaptations force otherwise good development practices (!)
  • 5. Scaling for the CloudTo leverage scalable infrastructure, you needScalable applicationScalable development practicesScalable culturePrinciples and practices discussed widely (particularly at QCon!)Convergence of Architecture, Agile, DevOps, etc.
  • 6. Universal Scalability LawThroughput limited by two factorsContention (α): queueing on shared resourceCoherency (β): communication and coordination among multiple nodesFormulated by Neil GuntherGeneralization of Amdahl’s LawGrounded in real-world physical processeshttp://www.perfdynamics.com/Manifesto/USLscalability.html
  • 7. Programming in the CloudParallelismLayeringServicesState managementData modelFailure handlingTesting
  • 8. ParallelismThink parallel!Simple parallel algorithm out-scales “smarter” non-parallel algorithmExploiting elasticity fundamentally requires parallelismRequest processingParallelism through Routing requestsAggregating servicesQueueing workAsync I/O and Futures are your friendsflickr.com/photos/sharif/2423144088/
  • 9. ParallelismOffline computationParallelism through Workload partitioningPartitioning data and processingE.g., pipelines, MapReduceflickr.com/photos/sharif/2423144088/“There are 3 rules to follow when parallelizing large codes. Unfortunately, no one knows what these rules are.” – W. Somerset Maugham and Gary Montry
  • 10. LayeringStrictly layered systemEach software layer handles a single set of responsibilitiesCloud makes this particularly importantCommon code in frameworksConfigurationInstrumentationFailure management“All problems in computer science can be solved by another level of indirection … Except for the problem of too many layers of indirection.” – David Wheeler
  • 11. ServicesDecompose system functionality into servicesSimpleSingle-purposeModularStatelessMulti-instanceCompose complex application behavior from simple elements“Make everything as simple as possible, but not simpler.” – Albert Einstein
  • 12. ServicesThe service should be the fundamental unit of …CompositionCombine simple services into complex systemsDependencyDepend on a service interface, not implementationAddressingTalk to logical endpoint (URI), not IP:portPersistenceAbstract and isolate persistence within a serviceDeployment
  • 13. State ManagementStateless instancesInstances are ephemeralMemory / storage is fast and local, but transient and inconsistent Equivalent to a cacheDurable state in persistent storage(Many implementations)“Here today, gone tomorrow.” – American proverb
  • 14. Key-Value Data ModelDistributed key-value storesSimpleHorizontally scalable(Many implementations)Constrained by designCannot express complex relationshipsLimited schemaPredictable, bounded performanceGreater burden on applicationJoins, aggregations, sorts, etc.Integrity and schema validation
  • 15. Key-Value Data ModelPlan to ShardPartition by keyParallelize writes for write throughputParallelize reads for read throughputPlan to DenormalizeOptimize for readsPrecalculate joins, aggregations, sortsUse async queue to updateLearn to tolerate transient inconsistency
  • 16. Failure HandlingExpect failures and handle theme.printStackTrace() does not count!Failure handling meansGraceful degradationTimeouts and retriesThrottling and back-offAbstract through frameworks and policiesflickr.com/photos/davidwatts1978/3199405401/“Hope is not a strategy.” – Various
  • 17. TestingTest early and oftenTest-driven and Test-first approaches work particularly well in the cloudAutomated testing works particularly wellIncremental development and deploymentTest end-to-endMuch easier to test at loadMore challenging to simulate all combinations and failure modes“In the data center, robust code is best practice. In the cloud, it is essential.” – Adrian Cockcroft
  • 18. Operating in the CloudDevOps MindsetConfiguration InjectionInstrumentationMonitoringMetering
  • 19. DevOps MindsetIn the Cloud, Developers  OpsEveryone will use tools for deployment, monitoring, etc.Manageability as an investmentManagement interfaces need as much engineering discipline as functional interfacesAutomate, automate, automateRepeatable builds and deploymentsProvisioning, scaling, failure management, etc.If you do it more than twice, script it
  • 20. Configuration InjectionBoot instance from bare minimum packageExternalize all variabilitySeparate code and configurationConfiguration should driveInstance roleService and resource dependenciesBehavior / capabilities InjectAt boot timeAt runtimeflickr.com/photos/andresrueda/2983149263/“I do my work at the same time each day – the last minute.” – Unknown
  • 21. InstrumentationFully instrument all componentsCannot attach debugger / profilerRemotely diagnose, profile, debugAvoid “monitoring fatigue”Logging is insufficientNeeds to be automatically interpretable and actionableUse a frameworkMake part of your infrastructureflickr.com/photos/wwarby/3016549999/
  • 22. MonitoringMonitor requests end-to-endTrace all requests as they flow from component to componentMonitor component activity and performanceMetrics, metrics, metricsUnderstand your typical system behaviorSpiky, flat, sinusoidal?Know the baseline so you know what is abnormalflickr.com/photos/pdstahl/3884421899/
  • 23. MeteringFixed cost -> variable costProcessingStorageNetworkEfficiency mattersAny savings goes directly to the bottom lineAny inefficiency is multiplied by many instances (!)“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%.” – Donald Knuth
  • 24. Evolving for the Cloud“It is not the strongest of the species that survives, nor the most intelligent that survives. It is the one that is the most adaptable to change.” – Charles Darwin