SlideShare une entreprise Scribd logo
1  sur  24
Being ElasticEvolving Programming for the Cloud Randy Shoup eBay Chief Engineer QCon San Francisco November 4, 2010
Cloud is a New Ecosystem Resource-Rich Inexpensive Available Elastic Managed Remote Virtual Variable Ephemeral Metered
The Old and the New flickr.com/photos/slapbcn/2035854990/
Developers Must Adapt Benefits are huge Constraints are real Adapt to the constraints to get the benefits Most adaptations force otherwise good development practices (!)
Scaling for the Cloud To leverage scalable infrastructure, you need Scalable application Scalable development practices Scalable culture Principles and practices discussed widely (particularly at QCon!) Convergence of Architecture, Agile, DevOps, etc.
Universal Scalability Law Throughput limited by two factors Contention (α):  queueing on shared resource Coherency (β):  communication and coordination among multiple nodes Formulated by Neil Gunther Generalization of Amdahl’s Law Grounded in real-world physical processes http://www.perfdynamics.com/Manifesto/USLscalability.html
Programming in the Cloud Parallelism Layering Services State management Data model Failure handling Testing
Parallelism Think parallel! Simple parallel algorithm out-scales “smarter” non-parallel algorithm Exploiting elasticity fundamentally requires parallelism Request processing Parallelism through  Routing requests Aggregating services Queueing work Async I/O and Futures are your friends flickr.com/photos/sharif/2423144088/
Parallelism Offline computation Parallelism through  Workload partitioning Partitioning data and processing E.g., pipelines, MapReduce flickr.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
Layering Strictly layered system Each software layer handles a single set of responsibilities Cloud makes this particularly important Common code in frameworks Configuration Instrumentation Failure 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
Services Decompose system functionality into services Simple Single-purpose Modular Stateless Multi-instance Compose complex application behavior from simple elements “Make everything as simple as possible, but not simpler.”  – Albert Einstein
Services The service should be the fundamental unit of … Composition Combine simple services into complex systems Dependency Depend on a service interface, not implementation Addressing Talk to logical endpoint (URI), not IP:port Persistence Abstract and isolate persistence within a service Deployment
State Management Stateless instances Instances are ephemeral Memory / storage is fast and local, but transient and inconsistent  Equivalent to a cache Durable state in persistent storage (Many implementations) “Here today, gone tomorrow.”  – American proverb
Key-Value Data Model Distributed key-value stores Simple Horizontally scalable (Many implementations) Constrained by design Cannot express complex relationships Limited schema Predictable, bounded performance Greater burden on application Joins, aggregations, sorts, etc. Integrity and schema validation
Key-Value Data Model Plan to Shard Partition by key Parallelize writes for write throughput Parallelize reads for read throughput Plan to Denormalize Optimize for reads Precalculate joins, aggregations, sorts Use async queue to update Learn to tolerate transient inconsistency
Failure Handling Expect failures and handle them e.printStackTrace() does not count! Failure handling means Graceful degradation Timeouts and retries Throttling and back-off Abstract through frameworks and policies flickr.com/photos/davidwatts1978/3199405401/ “Hope is not a strategy.”  – Various
Testing Test early and often Test-driven and Test-first approaches work particularly well in the cloud Automated testing works particularly well Incremental development and deployment Test end-to-end Much easier to test at load More 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 Cloud DevOps Mindset Configuration Injection Instrumentation Monitoring Metering
DevOps Mindset In the Cloud, Developers  Ops Everyone will use tools for deployment, monitoring, etc. Manageability as an investment Management interfaces need as much engineering discipline as functional interfaces Automate, automate, automate Repeatable builds and deployments Provisioning, scaling, failure management, etc. If you do it more than twice, script it
Configuration Injection Boot instance from bare minimum package Externalize all variability Separate code and configuration Configuration should drive Instance role Service and resource dependencies Behavior / capabilities  Inject At boot time At runtime flickr.com/photos/andresrueda/2983149263/ “I do my work at the same time each day – the last minute.”  – Unknown
Instrumentation Fully instrument all components Cannot attach debugger / profiler Remotely diagnose, profile, debug Avoid “monitoring fatigue” Logging is insufficient Needs to be automatically interpretable and actionable Use a framework Make part of your infrastructure flickr.com/photos/wwarby/3016549999/
Monitoring Monitor requests end-to-end Trace all requests as they flow from component to component Monitor component activity and performance Metrics, metrics, metrics Understand your typical system behavior Spiky, flat, sinusoidal? Know the baseline so you know what is abnormal flickr.com/photos/pdstahl/3884421899/
Metering Fixed cost -> variable cost Processing Storage Network Efficiency matters Any savings goes directly to the bottom line Any 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

Contenu connexe

Tendances

Software Architecture
Software ArchitectureSoftware Architecture
Software ArchitectureYoav Avrahami
 
Service Architectures at Scale
Service Architectures at ScaleService Architectures at Scale
Service Architectures at ScaleRandy Shoup
 
Effective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldEffective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldRandy Shoup
 
DevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibilityDevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibilityYoav Avrahami
 
devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!Andrew Shafer
 
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYEQCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYERandy Shoup
 
Turning Human Capital into High Performance Organizational Capital
Turning Human Capital into High Performance Organizational CapitalTurning Human Capital into High Performance Organizational Capital
Turning Human Capital into High Performance Organizational CapitalJohn Willis
 
Immutable Service Delivery Shenzhen 2016
Immutable Service Delivery   Shenzhen 2016Immutable Service Delivery   Shenzhen 2016
Immutable Service Delivery Shenzhen 2016John Willis
 
Dockercon USA 2016 - Immutable Awesomeness
Dockercon USA 2016 - Immutable Awesomeness Dockercon USA 2016 - Immutable Awesomeness
Dockercon USA 2016 - Immutable Awesomeness John Willis
 
Micro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmMicro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmEberhard Wolff
 
[WSO2Con EU 2017] Darwin Ate My App
[WSO2Con EU 2017] Darwin Ate My App[WSO2Con EU 2017] Darwin Ate My App
[WSO2Con EU 2017] Darwin Ate My AppWSO2
 
Embracing Failure - Fault Injection and Service Resilience at Netflix
Embracing Failure - Fault Injection and Service Resilience at NetflixEmbracing Failure - Fault Injection and Service Resilience at Netflix
Embracing Failure - Fault Injection and Service Resilience at NetflixJosh Evans
 
Top 5 Java Performance Metrics, Tips & Tricks
Top 5 Java Performance Metrics, Tips & TricksTop 5 Java Performance Metrics, Tips & Tricks
Top 5 Java Performance Metrics, Tips & TricksAppDynamics
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best PracticesPavel Mička
 
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...WinOps Conf
 
Architecting for Enterprise with JavaScript
Architecting for Enterprise with JavaScriptArchitecting for Enterprise with JavaScript
Architecting for Enterprise with JavaScriptKurtis Kemple
 
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveAPI Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveNiall Roche
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisEberhard Wolff
 
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy EnvironmentsDOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy EnvironmentsDevOps Enterprise Summmit
 
Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Refactoring Organizations - A Netflix Study (QCon NYC 2017)Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Refactoring Organizations - A Netflix Study (QCon NYC 2017)Josh Evans
 

Tendances (20)

Software Architecture
Software ArchitectureSoftware Architecture
Software Architecture
 
Service Architectures at Scale
Service Architectures at ScaleService Architectures at Scale
Service Architectures at Scale
 
Effective Microservices In a Data-centric World
Effective Microservices In a Data-centric WorldEffective Microservices In a Data-centric World
Effective Microservices In a Data-centric World
 
DevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibilityDevOps is not a Culture. It is about responsibility
DevOps is not a Culture. It is about responsibility
 
devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!
 
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYEQCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
QCon New York 2014 - Scalable, Reliable Analytics Infrastructure at KIXEYE
 
Turning Human Capital into High Performance Organizational Capital
Turning Human Capital into High Performance Organizational CapitalTurning Human Capital into High Performance Organizational Capital
Turning Human Capital into High Performance Organizational Capital
 
Immutable Service Delivery Shenzhen 2016
Immutable Service Delivery   Shenzhen 2016Immutable Service Delivery   Shenzhen 2016
Immutable Service Delivery Shenzhen 2016
 
Dockercon USA 2016 - Immutable Awesomeness
Dockercon USA 2016 - Immutable Awesomeness Dockercon USA 2016 - Immutable Awesomeness
Dockercon USA 2016 - Immutable Awesomeness
 
Micro Service – The New Architecture Paradigm
Micro Service – The New Architecture ParadigmMicro Service – The New Architecture Paradigm
Micro Service – The New Architecture Paradigm
 
[WSO2Con EU 2017] Darwin Ate My App
[WSO2Con EU 2017] Darwin Ate My App[WSO2Con EU 2017] Darwin Ate My App
[WSO2Con EU 2017] Darwin Ate My App
 
Embracing Failure - Fault Injection and Service Resilience at Netflix
Embracing Failure - Fault Injection and Service Resilience at NetflixEmbracing Failure - Fault Injection and Service Resilience at Netflix
Embracing Failure - Fault Injection and Service Resilience at Netflix
 
Top 5 Java Performance Metrics, Tips & Tricks
Top 5 Java Performance Metrics, Tips & TricksTop 5 Java Performance Metrics, Tips & Tricks
Top 5 Java Performance Metrics, Tips & Tricks
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
 
Architecting for Enterprise with JavaScript
Architecting for Enterprise with JavaScriptArchitecting for Enterprise with JavaScript
Architecting for Enterprise with JavaScript
 
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's PerspectiveAPI Architecture Summit 2014- APIs: A Mobile Developer's Perspective
API Architecture Summit 2014- APIs: A Mobile Developer's Perspective
 
Continuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A SymbiosisContinuous Delivery and Micro Services - A Symbiosis
Continuous Delivery and Micro Services - A Symbiosis
 
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy EnvironmentsDOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
DOES14: Scott Prugh, CSG - DevOps and Lean in Legacy Environments
 
Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Refactoring Organizations - A Netflix Study (QCon NYC 2017)Refactoring Organizations - A Netflix Study (QCon NYC 2017)
Refactoring Organizations - A Netflix Study (QCon NYC 2017)
 

En vedette

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

En vedette (7)

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

Similaire à Being Elastic -- Evolving Programming for the Cloud

An agile approach to cloud infrastructure
An agile approach to cloud infrastructureAn agile approach to cloud infrastructure
An agile approach to cloud infrastructureRichard Seroter
 
Designing distributed systems
Designing distributed systemsDesigning distributed systems
Designing distributed systemsMalisa Ncube
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)John Pape
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3Diane Allen
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architectureFaren faren
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Richard Banks
 
SW Architecture Monolithic to SOA
SW Architecture Monolithic to SOASW Architecture Monolithic to SOA
SW Architecture Monolithic to SOARaman Kannan
 
Life & Work of Butler Lampson | Turing100@Persistent
Life & Work of Butler Lampson | Turing100@PersistentLife & Work of Butler Lampson | Turing100@Persistent
Life & Work of Butler Lampson | Turing100@PersistentPersistent Systems Ltd.
 
Gluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A ChallengeGluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A ChallengeAdrian Cockcroft
 
Scalable service architectures @ BWS16
Scalable service architectures @ BWS16Scalable service architectures @ BWS16
Scalable service architectures @ BWS16Zoltán Németh
 
Deconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven DesignDeconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven DesignVMware Tanzu
 
Proactive ops for container orchestration environments
Proactive ops for container orchestration environmentsProactive ops for container orchestration environments
Proactive ops for container orchestration environmentsDocker, Inc.
 
Debs 2011 tutorial on non functional properties of event processing
Debs 2011 tutorial  on non functional properties of event processingDebs 2011 tutorial  on non functional properties of event processing
Debs 2011 tutorial on non functional properties of event processingOpher Etzion
 
Why Cloud Management Makes Sense
Why Cloud Management Makes SenseWhy Cloud Management Makes Sense
Why Cloud Management Makes SenseRightScale
 

Similaire à Being Elastic -- Evolving Programming for the Cloud (20)

An agile approach to cloud infrastructure
An agile approach to cloud infrastructureAn agile approach to cloud infrastructure
An agile approach to cloud infrastructure
 
Designing distributed systems
Designing distributed systemsDesigning distributed systems
Designing distributed systems
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Best practice adoption (and lack there of)
Best practice adoption (and lack there of)Best practice adoption (and lack there of)
Best practice adoption (and lack there of)
 
Linux Assignment 3
Linux Assignment 3Linux Assignment 3
Linux Assignment 3
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
12-Factor App
12-Factor App12-Factor App
12-Factor App
 
Azure and cloud design patterns
Azure and cloud design patternsAzure and cloud design patterns
Azure and cloud design patterns
 
Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016Microservices with .Net - NDC Sydney, 2016
Microservices with .Net - NDC Sydney, 2016
 
SW Architecture Monolithic to SOA
SW Architecture Monolithic to SOASW Architecture Monolithic to SOA
SW Architecture Monolithic to SOA
 
Life & Work of Butler Lampson | Turing100@Persistent
Life & Work of Butler Lampson | Turing100@PersistentLife & Work of Butler Lampson | Turing100@Persistent
Life & Work of Butler Lampson | Turing100@Persistent
 
Gluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A ChallengeGluecon Monitoring Microservices and Containers: A Challenge
Gluecon Monitoring Microservices and Containers: A Challenge
 
Hello cloud 5
Hello  cloud 5Hello  cloud 5
Hello cloud 5
 
Scalable service architectures @ BWS16
Scalable service architectures @ BWS16Scalable service architectures @ BWS16
Scalable service architectures @ BWS16
 
Deconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven DesignDeconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven Design
 
Netkit
NetkitNetkit
Netkit
 
Proactive ops for container orchestration environments
Proactive ops for container orchestration environmentsProactive ops for container orchestration environments
Proactive ops for container orchestration environments
 
Debs 2011 tutorial on non functional properties of event processing
Debs 2011 tutorial  on non functional properties of event processingDebs 2011 tutorial  on non functional properties of event processing
Debs 2011 tutorial on non functional properties of event processing
 
Why Cloud Management Makes Sense
Why Cloud Management Makes SenseWhy Cloud Management Makes Sense
Why Cloud Management Makes Sense
 
Distributed Systems in Data Engineering
Distributed Systems in Data EngineeringDistributed Systems in Data Engineering
Distributed Systems in Data Engineering
 

Plus de Randy Shoup

Large Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityLarge Scale Architecture -- The Unreasonable Effectiveness of Simplicity
Large Scale Architecture -- The Unreasonable Effectiveness of SimplicityRandy Shoup
 
Anatomy of Three Incidents -- Commonalities and Lessons
Anatomy of Three Incidents -- Commonalities and LessonsAnatomy of Three Incidents -- Commonalities and Lessons
Anatomy of Three Incidents -- Commonalities and LessonsRandy Shoup
 
One Terrible Day at Google, and How It Made Us Better
One Terrible Day at Google, and How It Made Us BetterOne Terrible Day at Google, and How It Made Us Better
One Terrible Day at Google, and How It Made Us BetterRandy Shoup
 
Scaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermScaling Your Architecture for the Long Term
Scaling Your Architecture for the Long TermRandy Shoup
 
Minimal Viable Architecture - Silicon Slopes 2020
Minimal Viable Architecture - Silicon Slopes 2020Minimal Viable Architecture - Silicon Slopes 2020
Minimal Viable Architecture - Silicon Slopes 2020Randy Shoup
 
An Agile Approach to Machine Learning
An Agile Approach to Machine LearningAn Agile Approach to Machine Learning
An Agile Approach to Machine LearningRandy Shoup
 
Moving Fast at Scale
Moving Fast at ScaleMoving Fast at Scale
Moving Fast at ScaleRandy Shoup
 
Breaking Codes, Designing Jets, and Building Teams
Breaking Codes, Designing Jets, and Building TeamsBreaking Codes, Designing Jets, and Building Teams
Breaking Codes, Designing Jets, and Building TeamsRandy Shoup
 
Scaling Your Architecture with Services and Events
Scaling Your Architecture with Services and EventsScaling Your Architecture with Services and Events
Scaling Your Architecture with Services and EventsRandy Shoup
 
Learning from Learnings: Anatomy of Three Incidents
Learning from Learnings: Anatomy of Three IncidentsLearning from Learnings: Anatomy of Three Incidents
Learning from Learnings: Anatomy of Three IncidentsRandy Shoup
 
Minimum Viable Architecture - Good Enough is Good Enough
Minimum Viable Architecture - Good Enough is Good EnoughMinimum Viable Architecture - Good Enough is Good Enough
Minimum Viable Architecture - Good Enough is Good EnoughRandy Shoup
 
Managing Data at Scale - Microservices and Events
Managing Data at Scale - Microservices and EventsManaging Data at Scale - Microservices and Events
Managing Data at Scale - Microservices and EventsRandy Shoup
 
Moving Fast At Scale
Moving Fast At ScaleMoving Fast At Scale
Moving Fast At ScaleRandy Shoup
 
DevOps - It's About How We Work
DevOps - It's About How We WorkDevOps - It's About How We Work
DevOps - It's About How We WorkRandy Shoup
 
Ten Lessons of the DevOps Transition
Ten Lessons of the DevOps TransitionTen Lessons of the DevOps Transition
Ten Lessons of the DevOps TransitionRandy Shoup
 
Managing Data in Microservices
Managing Data in MicroservicesManaging Data in Microservices
Managing Data in MicroservicesRandy Shoup
 
QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...
QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...
QCon Tokyo 2014 - Virtuous Cycles of Velocity: What I Learned About Going Fas...Randy Shoup
 

Plus de Randy Shoup (17)

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

Being Elastic -- Evolving Programming for the Cloud

  • 1. Being ElasticEvolving Programming for the Cloud Randy Shoup eBay Chief Engineer QCon San Francisco November 4, 2010
  • 2. Cloud is a New Ecosystem Resource-Rich Inexpensive Available Elastic Managed Remote Virtual Variable Ephemeral Metered
  • 3. The Old and the New flickr.com/photos/slapbcn/2035854990/
  • 4. Developers Must Adapt Benefits are huge Constraints are real Adapt to the constraints to get the benefits Most adaptations force otherwise good development practices (!)
  • 5. Scaling for the Cloud To leverage scalable infrastructure, you need Scalable application Scalable development practices Scalable culture Principles and practices discussed widely (particularly at QCon!) Convergence of Architecture, Agile, DevOps, etc.
  • 6. Universal Scalability Law Throughput limited by two factors Contention (α): queueing on shared resource Coherency (β): communication and coordination among multiple nodes Formulated by Neil Gunther Generalization of Amdahl’s Law Grounded in real-world physical processes http://www.perfdynamics.com/Manifesto/USLscalability.html
  • 7. Programming in the Cloud Parallelism Layering Services State management Data model Failure handling Testing
  • 8. Parallelism Think parallel! Simple parallel algorithm out-scales “smarter” non-parallel algorithm Exploiting elasticity fundamentally requires parallelism Request processing Parallelism through Routing requests Aggregating services Queueing work Async I/O and Futures are your friends flickr.com/photos/sharif/2423144088/
  • 9. Parallelism Offline computation Parallelism through Workload partitioning Partitioning data and processing E.g., pipelines, MapReduce flickr.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. Layering Strictly layered system Each software layer handles a single set of responsibilities Cloud makes this particularly important Common code in frameworks Configuration Instrumentation Failure 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. Services Decompose system functionality into services Simple Single-purpose Modular Stateless Multi-instance Compose complex application behavior from simple elements “Make everything as simple as possible, but not simpler.” – Albert Einstein
  • 12. Services The service should be the fundamental unit of … Composition Combine simple services into complex systems Dependency Depend on a service interface, not implementation Addressing Talk to logical endpoint (URI), not IP:port Persistence Abstract and isolate persistence within a service Deployment
  • 13. State Management Stateless instances Instances are ephemeral Memory / storage is fast and local, but transient and inconsistent Equivalent to a cache Durable state in persistent storage (Many implementations) “Here today, gone tomorrow.” – American proverb
  • 14. Key-Value Data Model Distributed key-value stores Simple Horizontally scalable (Many implementations) Constrained by design Cannot express complex relationships Limited schema Predictable, bounded performance Greater burden on application Joins, aggregations, sorts, etc. Integrity and schema validation
  • 15. Key-Value Data Model Plan to Shard Partition by key Parallelize writes for write throughput Parallelize reads for read throughput Plan to Denormalize Optimize for reads Precalculate joins, aggregations, sorts Use async queue to update Learn to tolerate transient inconsistency
  • 16. Failure Handling Expect failures and handle them e.printStackTrace() does not count! Failure handling means Graceful degradation Timeouts and retries Throttling and back-off Abstract through frameworks and policies flickr.com/photos/davidwatts1978/3199405401/ “Hope is not a strategy.” – Various
  • 17. Testing Test early and often Test-driven and Test-first approaches work particularly well in the cloud Automated testing works particularly well Incremental development and deployment Test end-to-end Much easier to test at load More 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 Cloud DevOps Mindset Configuration Injection Instrumentation Monitoring Metering
  • 19. DevOps Mindset In the Cloud, Developers  Ops Everyone will use tools for deployment, monitoring, etc. Manageability as an investment Management interfaces need as much engineering discipline as functional interfaces Automate, automate, automate Repeatable builds and deployments Provisioning, scaling, failure management, etc. If you do it more than twice, script it
  • 20. Configuration Injection Boot instance from bare minimum package Externalize all variability Separate code and configuration Configuration should drive Instance role Service and resource dependencies Behavior / capabilities Inject At boot time At runtime flickr.com/photos/andresrueda/2983149263/ “I do my work at the same time each day – the last minute.” – Unknown
  • 21. Instrumentation Fully instrument all components Cannot attach debugger / profiler Remotely diagnose, profile, debug Avoid “monitoring fatigue” Logging is insufficient Needs to be automatically interpretable and actionable Use a framework Make part of your infrastructure flickr.com/photos/wwarby/3016549999/
  • 22. Monitoring Monitor requests end-to-end Trace all requests as they flow from component to component Monitor component activity and performance Metrics, metrics, metrics Understand your typical system behavior Spiky, flat, sinusoidal? Know the baseline so you know what is abnormal flickr.com/photos/pdstahl/3884421899/
  • 23. Metering Fixed cost -> variable cost Processing Storage Network Efficiency matters Any savings goes directly to the bottom line Any 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