SlideShare a Scribd company logo
1 of 36
Service Architectures
at Scale
Randy Shoup
@randyshoup
linkedin.com/in/randyshoup
Background
• VP Engineering at WeWork
o Physical space as a service
• VP Engineering at Stitch Fix
o Revolutionizing retail using data science and machine learning
• Director of Engineering for Google App Engine
o World’s largest Platform-as-a-Service
• Chief Engineer at eBay
o Multiple generations of eBay’s infrastructure
Architecture Evolution
• eBay
• 5th generation today
• Monolithic Perl  Monolithic C++  Java  microservices
• Twitter
• 3rd generation today
• Monolithic Rails  JS / Rails / Scala  microservices
• Amazon
• Nth generation today
• Monolithic C++  Java / Scala  microservices
No one starts with microservices
…
Past a certain scale, everyone
ends up with microservices
First Law of Distributed Object
Design:
Don’t distribute your objects!
-- Martin Fowler
If you don’t end up regretting
your early technology
decisions, you probably over-
engineered.
Service Architecture
• Service Design
• Service Ecosystem
• Service Operation and Deployment
Service Architecture
• Service Design
• Service Ecosystem
• Service Operation and Deployment
Well-Engineered Microservices
• Single-purpose
• Simple, well-defined interface
• Modular and independent
• Isolated persistence (!)
A
C D E
B
Service as System of Record
• Single System of Record
o Every piece of data is owned by a single service
o That service is the canonical system of record for that data
• Every other copy is a read-only, non-authoritative cache
@randyshoup linkedin.com/in/randyshoup
customer-service
styling-service
customer-search
billing-service
Service Interface
• A service interface includes
o Synchronous request-response (REST, gRPC, etc)
o Events the service produces
o Events the service consumes
o Bulk reads and writes (ETL)
• Events are a first-class part of a service interface
• The interface includes any mechanism for getting data in or
out of the service (!)
@randyshoup linkedin.com/in/randyshoup
Service Interfaces / Prototypes
• Define Service Interface (Formally!)
o Propose
o Discuss with client(s)
o Agree
• Prototype Implementation
o Limited investment of time and people
o Simplest thing that could possibly work
o Client can integrate with prototype
o Implementor can learn what works and what does not
Service Interfaces / Prototypes
• Real Implementation
o Throw away the prototype (!)
•  Rinse and Repeat
Maintaining Interface Stability
• Backward / forward compatibility of interfaces
o Can *never* break your clients’ code
• Semantic versioning (major.minor.patch)
o Often multiple interface versions
o Sometimes multiple deployments
• Explicit deprecation policy
o Strong incentive to wean customers off old versions (!)
Service Design Anti-Patterns
• The “Mega-Service”
o Overbroad area of responsibility is difficult to reason about, change
o Leads to more upstream / downstream dependencies
• “Leaky Abstraction” Service
o Interface reflects provider’s implementation, not the consumer’s model
o Consumer’s model is typically more aligned with the domain, simpler, more abstract
o Leaking provider’s model in the interface constrains evolution of the implementation
Service Design Anti-Patterns
• “Client-less” Service
o Service built without a specific client in mind
o Very difficult to design a minimal, complete interface without a tangible use-case
o Opportunity cost and wasted effort
o Usage is the true metric of the value of a service
• Shared persistence
o Breaks encapsulation, encourages “backdoor” interface violations
o Unhealthy and near-invisible coupling of services
o (-) Initial eBay SOA efforts
Service Architecture
• Service Design
• Service Ecosystem
• Service Operation and Deployment
Ecosystem of Services
• Hundreds to thousands of
independent services
• Many layers of dependencies, no
strict tiers
• Graph of relationships, not a
hierarchy
C
B
A E
F
G
D
Google Service Layering
• Cloud Datastore: NoSQL service
o Strong transactional consistency
o SQL-like rich query capabilities
• Megastore: geo-scale structured database
o Multi-row transactions
o Synchronous cross-datacenter replication
• Bigtable: cluster-level structured storage
o (row, column, timestamp) -> cell contents
• Colossus: distributed file system
o Block distribution and replication
• Borg: cluster management infrastructure
o Task scheduling, machine assignment
Cloud Datastore
Megastore
Bigtable
Colossus
Cluster manager
Evolution, not Central Control
• No centralized design or approval
o Most technology decisions made locally instead of globally
• Build services as needed
o Create / extract new services when needed to solve a problem
o Services justify their continued existence through usage
o Deprecate services when no longer used
• Appearance of clean layering is an emergent property
“Every service at Google is
either deprecated or not ready
yet.”
-- Google engineering proverb
Standardization
• Standardized communication
o Network protocols
o Data formats
o Interface schema / specification
• Standardized infrastructure
o Source control
o Configuration management
o Cluster management
o Monitoring, alerting, diagnosing, etc.
“Enforcing” Standardization
• Encouraged via
o Libraries
o Support in underlying services
o Code reviews
o Searchable code
The easiest way to “enforce” a
standard practice is with
working code.
In a healthy service
ecosystem, standards become
standards by being better than
the alternatives.
Service Relationships
• Vendor – Customer Relationship
o Friendly and cooperative, but structured
o Clear ownership and division of responsibility
• Customer Focus
o Value of service comes from its value to its customers
• Customer can choose to use service or not (!)
o Must be strictly better than the alternatives of build, buy, borrow
Service Relationships
• Competition keeps system healthy
o If a common service is no longer useful, we can redeploy its resources
• Incentives are aligned
o Usage is an objective measure of a service’s success
Service Architecture
• Service Design
• Service Ecosystem
• Service Operation and Deployment
Goals of a Service Owner
• Meet the needs of my clients …
• Functionality
• Quality
• Performance
• Stability and reliability
• Constant improvement over time
• … at minimum cost and effort
• Leverage common tools and infrastructure
• Leverage other services
• Automate building, deploying, and operating my service
• Optimize for efficient use of resources
Bounded Context
• Primary focus on my service
o Clients which depend on my service
o Services which my service depends on
• Very little worry about
o The complete ecosystem
o The underlying infrastructure
• Cognitive load is very bounded
•  Small, nimble service teams
Service
Client
A
Client
B
Client
C
Incremental Change
• Decompose every change into incremental steps
• Each step maintains backward / forward compatibility of
data and interfaces
• Multiple service versions commonly coexist
o Every change is a rolling upgrade
o Transitional states are normal, not exceptional
Example: Data Migration
• Requires dual data processing and storage (“dual
writes”)
• Careful set of transitional steps
o A  A | B  B | A  B
A
A
A A A A
A
BB B
B
BB BB B
B
BB A
A
A BB B
B
Service Deployment
• Automated Pipeline
o Push-button, repeatable pipeline of build, test, deploy
• Independent Deployment
o Each service deployed independently, *not* as a group
• Incremental Deployment
o Canary testing
o Staged rollouts by %
Service Deployment
• “Feature Flags”
o Decouple code deployment from feature deployment
o Rapidly turn on / off features without redeploying code
o Typically deploy with feature turned off, then turn on as a separate step
Service Architecture
• Service Design
• Service Ecosystem
• Service Operation and Deployment
Thank You!
• @randyshoup
• linkedin.com/in/randyshoup

More Related Content

What's hot

An Agile Approach to Machine Learning
An Agile Approach to Machine LearningAn Agile Approach to Machine Learning
An Agile Approach to Machine Learning
Randy 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 Work
Randy Shoup
 

What's hot (20)

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
 
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
 
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
 
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
 
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
 
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
 
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
 
Moving Fast at Scale
Moving Fast at ScaleMoving Fast at Scale
Moving Fast at Scale
 
DevOpsDays Silicon Valley 2014 - The Game of Operations
DevOpsDays Silicon Valley 2014 - The Game of OperationsDevOpsDays Silicon Valley 2014 - The Game of Operations
DevOpsDays Silicon Valley 2014 - The Game of Operations
 
Being Elastic -- Evolving Programming for the Cloud
Being Elastic -- Evolving Programming for the CloudBeing Elastic -- Evolving Programming for the Cloud
Being Elastic -- Evolving Programming for the Cloud
 
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...
 
From the Monolith to Microservices - CraftConf 2015
From the Monolith to Microservices - CraftConf 2015From the Monolith to Microservices - CraftConf 2015
From the Monolith to Microservices - CraftConf 2015
 
Best Practices for Large-Scale Websites -- Lessons from eBay
Best Practices for Large-Scale Websites -- Lessons from eBayBest Practices for Large-Scale Websites -- Lessons from eBay
Best Practices for Large-Scale Websites -- Lessons from eBay
 
THE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABELTHE PLEASURES OF ON-PREM, TOMER GABEL
THE PLEASURES OF ON-PREM, TOMER GABEL
 
ONE-SIZE DOESN'T FIT ALL - EFFECTIVELY (RE)EVALUATE A DATA SOLUTION FOR YOUR ...
ONE-SIZE DOESN'T FIT ALL - EFFECTIVELY (RE)EVALUATE A DATA SOLUTION FOR YOUR ...ONE-SIZE DOESN'T FIT ALL - EFFECTIVELY (RE)EVALUATE A DATA SOLUTION FOR YOUR ...
ONE-SIZE DOESN'T FIT ALL - EFFECTIVELY (RE)EVALUATE A DATA SOLUTION FOR YOUR ...
 
Object-oriented design for infrastructure-as-a-code - Anna Bankirer
Object-oriented design for infrastructure-as-a-code - Anna BankirerObject-oriented design for infrastructure-as-a-code - Anna Bankirer
Object-oriented design for infrastructure-as-a-code - Anna Bankirer
 
devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!devops, microservices, and platforms, oh my!
devops, microservices, and platforms, oh my!
 
Serverless Toronto helps Startups
Serverless Toronto helps StartupsServerless Toronto helps Startups
Serverless Toronto helps Startups
 
Velocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOpsVelocity Conference NYC 2014 - Real World DevOps
Velocity Conference NYC 2014 - Real World DevOps
 

Similar to Service Architectures at Scale

Similar to Service Architectures at Scale (20)

Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
Microservices Practitioner Summit Jan '15 - Microservice Ecosystems At Scale ...
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-Services
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15
 
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
 
Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference Ekon20 mORMot SOA Delphi Conference
Ekon20 mORMot SOA Delphi Conference
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
Pros & Cons of Microservices Architecture
Pros & Cons of Microservices ArchitecturePros & Cons of Microservices Architecture
Pros & Cons of Microservices Architecture
 
Azure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challengesAzure architecture design patterns - proven solutions to common challenges
Azure architecture design patterns - proven solutions to common challenges
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture Lessions Learned - Service Oriented Architecture
Lessions Learned - Service Oriented Architecture
 
Architecture Principles CodeStock
Architecture Principles CodeStock Architecture Principles CodeStock
Architecture Principles CodeStock
 
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
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Architectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and ConsistentlyArchitectural Decisions: Smoothly and Consistently
Architectural Decisions: Smoothly and Consistently
 
Microservices: The Best Practices
Microservices: The Best PracticesMicroservices: The Best Practices
Microservices: The Best Practices
 
Beyond DevOps: How Netflix Bridges the Gap?
Beyond DevOps: How Netflix Bridges the Gap?Beyond DevOps: How Netflix Bridges the Gap?
Beyond DevOps: How Netflix Bridges the Gap?
 
[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...
[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...
[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...
 
IWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them BothIWMW 2002: Portals and CMS:" Why You Need Them Both
IWMW 2002: Portals and CMS:" Why You Need Them Both
 

More from Randy Shoup

Ten Lessons of the DevOps Transition
Ten Lessons of the DevOps TransitionTen Lessons of the DevOps Transition
Ten Lessons of the DevOps Transition
Randy Shoup
 

More from Randy Shoup (8)

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
 
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
 
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
 
Why Enterprises Are Embracing the Cloud
Why Enterprises Are Embracing the CloudWhy Enterprises Are Embracing the Cloud
Why Enterprises Are Embracing the Cloud
 
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
 
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...
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 

Service Architectures at Scale

  • 1. Service Architectures at Scale Randy Shoup @randyshoup linkedin.com/in/randyshoup
  • 2. Background • VP Engineering at WeWork o Physical space as a service • VP Engineering at Stitch Fix o Revolutionizing retail using data science and machine learning • Director of Engineering for Google App Engine o World’s largest Platform-as-a-Service • Chief Engineer at eBay o Multiple generations of eBay’s infrastructure
  • 3. Architecture Evolution • eBay • 5th generation today • Monolithic Perl  Monolithic C++  Java  microservices • Twitter • 3rd generation today • Monolithic Rails  JS / Rails / Scala  microservices • Amazon • Nth generation today • Monolithic C++  Java / Scala  microservices
  • 4. No one starts with microservices … Past a certain scale, everyone ends up with microservices
  • 5. First Law of Distributed Object Design: Don’t distribute your objects! -- Martin Fowler
  • 6. If you don’t end up regretting your early technology decisions, you probably over- engineered.
  • 7. Service Architecture • Service Design • Service Ecosystem • Service Operation and Deployment
  • 8. Service Architecture • Service Design • Service Ecosystem • Service Operation and Deployment
  • 9. Well-Engineered Microservices • Single-purpose • Simple, well-defined interface • Modular and independent • Isolated persistence (!) A C D E B
  • 10. Service as System of Record • Single System of Record o Every piece of data is owned by a single service o That service is the canonical system of record for that data • Every other copy is a read-only, non-authoritative cache @randyshoup linkedin.com/in/randyshoup customer-service styling-service customer-search billing-service
  • 11. Service Interface • A service interface includes o Synchronous request-response (REST, gRPC, etc) o Events the service produces o Events the service consumes o Bulk reads and writes (ETL) • Events are a first-class part of a service interface • The interface includes any mechanism for getting data in or out of the service (!) @randyshoup linkedin.com/in/randyshoup
  • 12. Service Interfaces / Prototypes • Define Service Interface (Formally!) o Propose o Discuss with client(s) o Agree • Prototype Implementation o Limited investment of time and people o Simplest thing that could possibly work o Client can integrate with prototype o Implementor can learn what works and what does not
  • 13. Service Interfaces / Prototypes • Real Implementation o Throw away the prototype (!) •  Rinse and Repeat
  • 14. Maintaining Interface Stability • Backward / forward compatibility of interfaces o Can *never* break your clients’ code • Semantic versioning (major.minor.patch) o Often multiple interface versions o Sometimes multiple deployments • Explicit deprecation policy o Strong incentive to wean customers off old versions (!)
  • 15. Service Design Anti-Patterns • The “Mega-Service” o Overbroad area of responsibility is difficult to reason about, change o Leads to more upstream / downstream dependencies • “Leaky Abstraction” Service o Interface reflects provider’s implementation, not the consumer’s model o Consumer’s model is typically more aligned with the domain, simpler, more abstract o Leaking provider’s model in the interface constrains evolution of the implementation
  • 16. Service Design Anti-Patterns • “Client-less” Service o Service built without a specific client in mind o Very difficult to design a minimal, complete interface without a tangible use-case o Opportunity cost and wasted effort o Usage is the true metric of the value of a service • Shared persistence o Breaks encapsulation, encourages “backdoor” interface violations o Unhealthy and near-invisible coupling of services o (-) Initial eBay SOA efforts
  • 17. Service Architecture • Service Design • Service Ecosystem • Service Operation and Deployment
  • 18. Ecosystem of Services • Hundreds to thousands of independent services • Many layers of dependencies, no strict tiers • Graph of relationships, not a hierarchy C B A E F G D
  • 19. Google Service Layering • Cloud Datastore: NoSQL service o Strong transactional consistency o SQL-like rich query capabilities • Megastore: geo-scale structured database o Multi-row transactions o Synchronous cross-datacenter replication • Bigtable: cluster-level structured storage o (row, column, timestamp) -> cell contents • Colossus: distributed file system o Block distribution and replication • Borg: cluster management infrastructure o Task scheduling, machine assignment Cloud Datastore Megastore Bigtable Colossus Cluster manager
  • 20. Evolution, not Central Control • No centralized design or approval o Most technology decisions made locally instead of globally • Build services as needed o Create / extract new services when needed to solve a problem o Services justify their continued existence through usage o Deprecate services when no longer used • Appearance of clean layering is an emergent property
  • 21. “Every service at Google is either deprecated or not ready yet.” -- Google engineering proverb
  • 22. Standardization • Standardized communication o Network protocols o Data formats o Interface schema / specification • Standardized infrastructure o Source control o Configuration management o Cluster management o Monitoring, alerting, diagnosing, etc.
  • 23. “Enforcing” Standardization • Encouraged via o Libraries o Support in underlying services o Code reviews o Searchable code
  • 24. The easiest way to “enforce” a standard practice is with working code.
  • 25. In a healthy service ecosystem, standards become standards by being better than the alternatives.
  • 26. Service Relationships • Vendor – Customer Relationship o Friendly and cooperative, but structured o Clear ownership and division of responsibility • Customer Focus o Value of service comes from its value to its customers • Customer can choose to use service or not (!) o Must be strictly better than the alternatives of build, buy, borrow
  • 27. Service Relationships • Competition keeps system healthy o If a common service is no longer useful, we can redeploy its resources • Incentives are aligned o Usage is an objective measure of a service’s success
  • 28. Service Architecture • Service Design • Service Ecosystem • Service Operation and Deployment
  • 29. Goals of a Service Owner • Meet the needs of my clients … • Functionality • Quality • Performance • Stability and reliability • Constant improvement over time • … at minimum cost and effort • Leverage common tools and infrastructure • Leverage other services • Automate building, deploying, and operating my service • Optimize for efficient use of resources
  • 30. Bounded Context • Primary focus on my service o Clients which depend on my service o Services which my service depends on • Very little worry about o The complete ecosystem o The underlying infrastructure • Cognitive load is very bounded •  Small, nimble service teams Service Client A Client B Client C
  • 31. Incremental Change • Decompose every change into incremental steps • Each step maintains backward / forward compatibility of data and interfaces • Multiple service versions commonly coexist o Every change is a rolling upgrade o Transitional states are normal, not exceptional
  • 32. Example: Data Migration • Requires dual data processing and storage (“dual writes”) • Careful set of transitional steps o A  A | B  B | A  B A A A A A A A BB B B BB BB B B BB A A A BB B B
  • 33. Service Deployment • Automated Pipeline o Push-button, repeatable pipeline of build, test, deploy • Independent Deployment o Each service deployed independently, *not* as a group • Incremental Deployment o Canary testing o Staged rollouts by %
  • 34. Service Deployment • “Feature Flags” o Decouple code deployment from feature deployment o Rapidly turn on / off features without redeploying code o Typically deploy with feature turned off, then turn on as a separate step
  • 35. Service Architecture • Service Design • Service Ecosystem • Service Operation and Deployment
  • 36. Thank You! • @randyshoup • linkedin.com/in/randyshoup