SlideShare a Scribd company logo
1 of 36
Concurrency  at  Scale:      
The  Evolution  to  Micro-­‐‑Services	
Randy Shoup
@randyshoup
linkedin.com/in/randyshoup
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/reactive-services-scale
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon San Francisco
www.qconsf.com
Background	
•  CTO at KIXEYE
o  Real-time strategy games for web and mobile
•  Director of Engineering for Google App Engine
o  World’s largest Platform-as-a-Service
o  Part of Google Cloud Platform
•  Chief Engineer at eBay
o  Multiple generations of eBay’s real-time search infrastructure
Evolution  in  Action	
• 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++ à Perl / C++ à Java / Scala à microservices
Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
The  Monolithic  
Architecture	
2-3 monolithic tiers
•  {JS, iOS, Android}
•  {PHP, Ruby, Python}
•  {MySQL, Mongo}
Presentation	
Application	
Database
The  Monolithic  
Application	
Simple  at  first	
In-­‐‑process  latencies	
Single  codebase,  deploy  unit	
Resource-­‐‑efficient  at  small  scale	
Pros	
Coordination  overhead  as  team  
grows	
Poor  enforcement  of  modularity	
Poor  scaling  (vertical  only)	
All-­‐‑or-­‐‑nothing  deploy  (downtime,  
failures)	
Long  build  times	
Cons
The  Monolithic    
Database	
Simple  at  first	
Join  queries  are  easy	
Single  schema,  deployment	
Resource-­‐‑efficient  at  small  scale	
Pros	
Coupling  over  time	
Poor  scaling  and  redundancy  (all-­‐‑
or-­‐‑nothing,  vertical  only)	
Difficult  to  tune  properly	
All-­‐‑or-­‐‑nothing  schema  
management	
Cons
“If  you  don’t  end  up  regrePing  
your  early  technology  
decisions,  you  probably  over-­‐‑
engineered”	
-- me
Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
Micro-­‐‑Services  
	
“Loosely-­‐‑coupled  service  
oriented  architecture  with  
bounded  contexts”	
-- Adrian Cockcroft
Micro-­‐‑Services  
	
“Loosely-­‐‑coupled  service  
oriented  architecture  with  
bounded  contexts”	
-- Adrian Cockcroft
Micro-­‐‑Services  
	
“Loosely-­‐‑coupled  service  
oriented  architecture  with  
bounded  contexts”	
-- Adrian Cockcroft
Micro-­‐‑Services  
	
“Loosely-­‐‑coupled  service  
oriented  architecture  with  
bounded  contexts”	
-- Adrian Cockcroft
Micro-­‐‑Services  
	
•  Single-purpose
•  Simple, well-defined interface
•  Modular and independent
•  More graph of relationships than tiers
•  Fullest expression of encapsulation and modularity
•  Isolated persistence (!)
A	
C	
 D	
 E	
B
Micro-­‐‑Services  
	
Each  unit  is  simple	
Independent  scaling  and  
performance	
Independent  testing  and  
deployment	
Can  optimally  tune  performance  
(caching,  replication,  etc.)	
Pros	
Many  cooperating  units	
Many  small  repos	
Requires  more  sophisticated  tooling  
and  dependency  management	
Network  latencies	
Cons
Google  Services	
•  All engineering groups organized into “services”
•  Gmail, App Engine, Bigtable, etc.
•  Self-sufficient and autonomous
•  Layered on one another
è Very small teams achieve great things
Google    
Cloud  Datastore	
•  Cloud Datastore: NoSQL service
o  Highly scalable and resilient
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: next-generation clustered file
system
o  Block distribution and replication
•  Cluster management infrastructure
o  Task scheduling, machine assignment
Cloud  
Datastore	
Megastore	
Bigtable	
Colossus	
Cluster  
manager
Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
Reactive  
Micro-­‐‑Services	
•  Responsive
o  Predictable performance at 99%ile trumps low mean latency (!)
o  Tail latencies far more important than mean or median
o  Client protects itself with asynchronous, non-blocking calls
•  Resilient
o  Redundancy for machine / cluster / data center failures
o  Load-balancing and flow control for service invocations
o  Client protects itself with standard failure management patterns: timeouts,
retries, circuit breakers
Reactive  
Micro-­‐‑Services	
•  Elastic
o  Scale up and down service instances according to load
o  Gracefully handle spiky workloads
o  Predictive and reactive scaling
•  Message-Driven
o  Asynchronous message-passing over synchronous request-response
o  Often custom protocol over TCP / UDP or WebSockets over HTTP
KIXEYE  
Game  Services	
•  Minimize request latency
o  Respond as rapidly as possible to client
•  Functional Reactive + Actor model
o  Highly asynchronous, never block (!)
o  Queue events / messages for complex work
o  Heavy use of Scala / Akka and RxJava at KIXEYE
•  Highly Scalable and Productive
o  (-) eBay uses threaded synchronous model
o  (-) Google uses complicated callback-based asynchronous model
KIXEYE    
Service  Chassis	
•  Goal: Make it easy to build and deploy micro-services
•  Chassis core
•  Configuration integration
•  Registration and Discovery
•  Monitoring and Metrics
•  Load-balancing for downstream services
•  Failure management for downstream services
•  Development / Deployment Pipeline
•  Transport layer over REST / JSON or WebSockets
•  Service template in Maven
•  Build pipeline through Puppet -> Packer -> AMI
•  Red-black deployment via Asgard
KIXEYE    
Service  Chassis	
•  Heavy use of NetflixOSS
•  Asgard
•  Hystrix
•  Ribbon + WebSockets è Janus
•  Eureka
è  Results
•  15 minutes from no code to running service in AWS (!)
•  Open-sourced at https://github.com/Kixeye
Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
Migrating    
Incrementally	
• Find your worst scaling bottleneck
• Wall it off behind an interface
• Replace it
• è Rinse and Repeat
Building    
Micro-­‐‑Services	
•  Common Chassis / Framework
o  Make it trivially easy to build and maintain a service
•  Define Service Interface (Formally!)
o  Propose
o  Discuss with client(s)
o  Agree
•  Prototype Implementation
o  Simplest thing that could possibly work
o  Client can integrate with prototype
o  Implementor can learn what works and what does not
Building    
Micro-­‐‑Services	
•  Real Implementation
o  Throw away the prototype (!)
•  è Rinse and Repeat
“So  you  are  really  
serious  about  this  …”	
•  Distributed tracing
•  Trace a request chain through multiple service invocations
•  Network visualization
•  “Weighted” communication paths between microservices / instances
•  Latency, error rates, connection failures
•  Dashboard metrics
•  Quickly scan operational health of many services
•  Median, 99%ile, 99.9%ile, etc.
•  Netflix Hystrix / Turbine
Micro-­‐‑Service  
Organization	
•  Small, focused teams
•  Single service or set of related services
•  Minimal, well-defined “interface”
•  Autonomy
•  Freedom to choose technology, methodology, working environment
•  Responsibility for the results of those choices
•  Accountability
•  Give a team a goal, not a solution
•  Let team own the best way to achieve the goal
Micro-­‐‑Service  
Relationships	
•  Vendor – Customer Relationship
o  Friendly and cooperative, but structured
o  Clear ownership and division of responsibility
o  Customer can choose to use service or not (!)
•  Service-Level Agreement (SLA)
o  Promise of service levels by the provider
o  Customer needs to be able to rely on the service, like a utility
•  Charging and Cost Allocation
o  Charge customers for *usage* of the service
o  Aligns economic incentives of customer and provider
o  Motivates both sides to optimize
Recap:    Evolution  to    
Micro-­‐‑Services	
•  The Monolith
•  Micro-Services
•  Reactive Systems
•  Migrating to Micro-Services
Thank  You!	
•  @randyshoup
•  linkedin.com/in/randyshoup
•  Slides will be at slideshare.net/randyshoup
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/reactive-
services-scale

More Related Content

Viewers also liked

Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJavaParadigma Digital
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Trisha Gee
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Steve Pember
 
Futures and Rx Observables: powerful abstractions for consuming web services ...
Futures and Rx Observables: powerful abstractions for consuming web services ...Futures and Rx Observables: powerful abstractions for consuming web services ...
Futures and Rx Observables: powerful abstractions for consuming web services ...Chris Richardson
 
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Amazon Web Services
 
Coordenadas cilindricas y esfericas
Coordenadas cilindricas y esfericasCoordenadas cilindricas y esfericas
Coordenadas cilindricas y esfericasPSM Valencia
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaKasun Indrasiri
 
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Mitoc Group
 

Viewers also liked (8)

Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJava
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)
 
Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...Why Reactive Architecture Will Take Over The World (and why we should be wary...
Why Reactive Architecture Will Take Over The World (and why we should be wary...
 
Futures and Rx Observables: powerful abstractions for consuming web services ...
Futures and Rx Observables: powerful abstractions for consuming web services ...Futures and Rx Observables: powerful abstractions for consuming web services ...
Futures and Rx Observables: powerful abstractions for consuming web services ...
 
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
Introduction to Amazon Web Services - How to Scale your Next Idea on AWS : A ...
 
Coordenadas cilindricas y esfericas
Coordenadas cilindricas y esfericasCoordenadas cilindricas y esfericas
Coordenadas cilindricas y esfericas
 
Reactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-JavaReactive Programming in Java 8 with Rx-Java
Reactive Programming in Java 8 with Rx-Java
 
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
 

More from C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

More from C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Recently uploaded

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Concurrency at Large-Scale: The Evolution to Reactive Microservices

  • 1. Concurrency  at  Scale:       The  Evolution  to  Micro-­‐‑Services Randy Shoup @randyshoup linkedin.com/in/randyshoup
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /reactive-services-scale
  • 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon San Francisco www.qconsf.com
  • 4. Background •  CTO at KIXEYE o  Real-time strategy games for web and mobile •  Director of Engineering for Google App Engine o  World’s largest Platform-as-a-Service o  Part of Google Cloud Platform •  Chief Engineer at eBay o  Multiple generations of eBay’s real-time search infrastructure
  • 5. Evolution  in  Action • 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++ à Perl / C++ à Java / Scala à microservices
  • 6. Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 7. Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 8. The  Monolithic   Architecture 2-3 monolithic tiers •  {JS, iOS, Android} •  {PHP, Ruby, Python} •  {MySQL, Mongo} Presentation Application Database
  • 9. The  Monolithic   Application Simple  at  first In-­‐‑process  latencies Single  codebase,  deploy  unit Resource-­‐‑efficient  at  small  scale Pros Coordination  overhead  as  team   grows Poor  enforcement  of  modularity Poor  scaling  (vertical  only) All-­‐‑or-­‐‑nothing  deploy  (downtime,   failures) Long  build  times Cons
  • 10. The  Monolithic     Database Simple  at  first Join  queries  are  easy Single  schema,  deployment Resource-­‐‑efficient  at  small  scale Pros Coupling  over  time Poor  scaling  and  redundancy  (all-­‐‑ or-­‐‑nothing,  vertical  only) Difficult  to  tune  properly All-­‐‑or-­‐‑nothing  schema   management Cons
  • 11. “If  you  don’t  end  up  regrePing   your  early  technology   decisions,  you  probably  over-­‐‑ engineered” -- me
  • 12. Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 13. Micro-­‐‑Services   “Loosely-­‐‑coupled  service   oriented  architecture  with   bounded  contexts” -- Adrian Cockcroft
  • 14. Micro-­‐‑Services   “Loosely-­‐‑coupled  service   oriented  architecture  with   bounded  contexts” -- Adrian Cockcroft
  • 15. Micro-­‐‑Services   “Loosely-­‐‑coupled  service   oriented  architecture  with   bounded  contexts” -- Adrian Cockcroft
  • 16. Micro-­‐‑Services   “Loosely-­‐‑coupled  service   oriented  architecture  with   bounded  contexts” -- Adrian Cockcroft
  • 17. Micro-­‐‑Services   •  Single-purpose •  Simple, well-defined interface •  Modular and independent •  More graph of relationships than tiers •  Fullest expression of encapsulation and modularity •  Isolated persistence (!) A C D E B
  • 18. Micro-­‐‑Services   Each  unit  is  simple Independent  scaling  and   performance Independent  testing  and   deployment Can  optimally  tune  performance   (caching,  replication,  etc.) Pros Many  cooperating  units Many  small  repos Requires  more  sophisticated  tooling   and  dependency  management Network  latencies Cons
  • 19. Google  Services •  All engineering groups organized into “services” •  Gmail, App Engine, Bigtable, etc. •  Self-sufficient and autonomous •  Layered on one another è Very small teams achieve great things
  • 20. Google     Cloud  Datastore •  Cloud Datastore: NoSQL service o  Highly scalable and resilient 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: next-generation clustered file system o  Block distribution and replication •  Cluster management infrastructure o  Task scheduling, machine assignment Cloud   Datastore Megastore Bigtable Colossus Cluster   manager
  • 21. Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 22. Reactive   Micro-­‐‑Services •  Responsive o  Predictable performance at 99%ile trumps low mean latency (!) o  Tail latencies far more important than mean or median o  Client protects itself with asynchronous, non-blocking calls •  Resilient o  Redundancy for machine / cluster / data center failures o  Load-balancing and flow control for service invocations o  Client protects itself with standard failure management patterns: timeouts, retries, circuit breakers
  • 23. Reactive   Micro-­‐‑Services •  Elastic o  Scale up and down service instances according to load o  Gracefully handle spiky workloads o  Predictive and reactive scaling •  Message-Driven o  Asynchronous message-passing over synchronous request-response o  Often custom protocol over TCP / UDP or WebSockets over HTTP
  • 24. KIXEYE   Game  Services •  Minimize request latency o  Respond as rapidly as possible to client •  Functional Reactive + Actor model o  Highly asynchronous, never block (!) o  Queue events / messages for complex work o  Heavy use of Scala / Akka and RxJava at KIXEYE •  Highly Scalable and Productive o  (-) eBay uses threaded synchronous model o  (-) Google uses complicated callback-based asynchronous model
  • 25. KIXEYE     Service  Chassis •  Goal: Make it easy to build and deploy micro-services •  Chassis core •  Configuration integration •  Registration and Discovery •  Monitoring and Metrics •  Load-balancing for downstream services •  Failure management for downstream services •  Development / Deployment Pipeline •  Transport layer over REST / JSON or WebSockets •  Service template in Maven •  Build pipeline through Puppet -> Packer -> AMI •  Red-black deployment via Asgard
  • 26. KIXEYE     Service  Chassis •  Heavy use of NetflixOSS •  Asgard •  Hystrix •  Ribbon + WebSockets è Janus •  Eureka è  Results •  15 minutes from no code to running service in AWS (!) •  Open-sourced at https://github.com/Kixeye
  • 27. Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 28. Migrating     Incrementally • Find your worst scaling bottleneck • Wall it off behind an interface • Replace it • è Rinse and Repeat
  • 29. Building     Micro-­‐‑Services •  Common Chassis / Framework o  Make it trivially easy to build and maintain a service •  Define Service Interface (Formally!) o  Propose o  Discuss with client(s) o  Agree •  Prototype Implementation o  Simplest thing that could possibly work o  Client can integrate with prototype o  Implementor can learn what works and what does not
  • 30. Building     Micro-­‐‑Services •  Real Implementation o  Throw away the prototype (!) •  è Rinse and Repeat
  • 31. “So  you  are  really   serious  about  this  …” •  Distributed tracing •  Trace a request chain through multiple service invocations •  Network visualization •  “Weighted” communication paths between microservices / instances •  Latency, error rates, connection failures •  Dashboard metrics •  Quickly scan operational health of many services •  Median, 99%ile, 99.9%ile, etc. •  Netflix Hystrix / Turbine
  • 32. Micro-­‐‑Service   Organization •  Small, focused teams •  Single service or set of related services •  Minimal, well-defined “interface” •  Autonomy •  Freedom to choose technology, methodology, working environment •  Responsibility for the results of those choices •  Accountability •  Give a team a goal, not a solution •  Let team own the best way to achieve the goal
  • 33. Micro-­‐‑Service   Relationships •  Vendor – Customer Relationship o  Friendly and cooperative, but structured o  Clear ownership and division of responsibility o  Customer can choose to use service or not (!) •  Service-Level Agreement (SLA) o  Promise of service levels by the provider o  Customer needs to be able to rely on the service, like a utility •  Charging and Cost Allocation o  Charge customers for *usage* of the service o  Aligns economic incentives of customer and provider o  Motivates both sides to optimize
  • 34. Recap:    Evolution  to     Micro-­‐‑Services •  The Monolith •  Micro-Services •  Reactive Systems •  Migrating to Micro-Services
  • 35. Thank  You! •  @randyshoup •  linkedin.com/in/randyshoup •  Slides will be at slideshare.net/randyshoup
  • 36. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/reactive- services-scale