SlideShare a Scribd company logo
1 of 46
From a monolith to
microservices + REST
The evolution of LinkedIn’s service architecture
by Steven Ihde and Karan Parikh (LinkedIn)
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
/linkedin-microservices-urn
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
Leo
● Our original codebase
● Java, Servlets, JSP, JDBC
Leo
Oracle
4
Remote Graph
● Graph: member-to-member connection
graph
● Complex graph traversal problems not
suited to SQL queries
● RPC was used to keep it separate from Leo
● Our first service
5
Remote Graph
Leo
Oracle
Graph
RPC
JDBC
Databus
6
Mid/Back Tier Services
● “Back” tier services encapsulate data
domains
● “Mid” tier services provide business logic
● We applied the service pattern to many
domains, e.g. member profiles, job postings,
group postings
7
Front Tier Services
● “Front” tier services aggregate data from
many domains
● Transform the data through templates to
present to the client
● Should be stateless for scaling purposes
8
Service Explosion
● Over 100 services by 2010
● Most new development occurring in
services, not Leo
● Site release every two weeks
9
Architectural Challenges
● Test failures
● Incompatibilities
● Complex orchestration
● Rollback difficult or impossible
● Complex dependencies between services
10
Microservices?
● Services were fine grained
● But monolithic build and release process
did not allow us to realize the benefits of
microservice architecture
11
Solutions
● Continuous delivery
● Break apart the code base
● Devolution of control
● Strict backwards compatibility
● Better defined boundaries between tiers
12
Continuous Delivery
● Shared trunk
● Pre- and post-commit automated testing
● Easy promotion of builds to production
environment
13
Decentralize Codebase
● Separate, independently buildable
repositories
● Shared trunk within each repository
● Versioned binary dependencies between
repositories
14
Devolution of Control
● Service owners control release schedule,
release criteria
● Service owners are responsible for
backwards compatibility
● Services must release independently
15
Backwards compatibility
● Insulates teams from each other at runtime
● Allows service owners to deploy on their
own schedule without impacting clients
16
Boundaries Between Tiers
● Limit aggregation to the front tier
● Limit crosstalk in the back tier:
“superblocks”
17
Boundaries Between Tiers
18
Java RPC
● Difficult to maintain backwards compatibility
● Verb-centric APIs
● Use case specific APIs
● Difficult to navigate the proliferation of
APIs
19
Rest.li plus Deco
equals Microservices
at LinkedIn
What is Rest.li?
“Rest.li is an open source REST framework
for building robust, scalable RESTful
architectures using type-safe bindings and
asynchronous, non-blocking I/O.”
Primarily JSON over HTTP.
21
Why Rest.li?
● Polyglot (frontend) ecosystem - Java,
Scala, Python, Node.js, Objective-C
● Uniform service interfaces (REST)
22
The Rest.li stack
Rest.li Data layer and RESTful operations
D2 Dynamic discovery and load balancing
R2 Network Communication
23
Request Response (R2)
● REST abstraction that can send messages
over any application layer protocol (HTTP,
PRPC (old custom LinkedIn protocol))
● Client - fully asynchronous Netty
● Server - Jetty, Netty (experimental)
Rest.li
D2
R2
24
Dynamic Discovery (D2)
● Apache ZooKeeper
● Dynamic server discovery
● Client side software load balancing
● D2 service
Rest.li
R2
D2
25
Rest.li
● Data using PDSCs (Pegasus Data
Schemas)
● RESTful API that developers use to build
services
● CRUD + finders + actions
● API and data backwards
compatibility checking
R2
D2
Rest.li
26
830 Rest.li resources.
90 billion Rest.li calls/day across
multiple datacenters.
65% service-to-service calls.
What is deco?
28
Aside: Normalized Domain Models
● Links over inclusion (denormalization)
● URNs are fully qualified
foreign keys
InfluencerPost
Long id
String title
String content
URN author
Member
Long id
String firstName
String lastName
String summary
URN company
29
What is Deco?
● URN resolution library
● What data you want, not how you want it
Time
1
2
3
30
Deco Example: Influencer Post
Dummy Post
by Karan Parikh
at LinkedIn
Hi QCon!
/influencerPosts
/influencerPosts
/companies
/profiles
31
Deco Example: Influencer Post
deco://influencerPosts/123?projection=(title,
content, author~(firstName, lastName,
company~(companyName)))
32
Three services.
One client call.
Deco.
Rest.li plus Deco
equals Microservices
at LinkedIn
How Rest.li enables Microservices
● Rest.li + D2 facilitate domain specific
services
● Services can easily configure clients via D2
● D2 helps us scale the architecture
35
How Deco enables Microservices
● Deals with service explosion
● Abstracts away services from clients
36
Challenges
● Coordinating a massive engineering effort.
(LiX to the rescue!)
● Ensuring uniform RESTful interfaces
● Performance
Rest.li API Hub37
Wins
● All languages talk to the same service
● Developer productivity
● Reduction of hardware load balancers
● Ability to expose APIs directly to third
parties
38
LinkedIn Microservices
Questions?
References and links
● Rest.li: http://rest.li/
● Rest.li API Hub: https://github.com/linkedin/rest.li-api-hub
● Rest.li user guide: https://github.com/linkedin/rest.li/wiki/Rest.li-User-Guide
● Modeling resources with Rest.li:
https://github.com/linkedin/rest.li/wiki/Modeling-Resources-with-Rest.li
● LinkedIn engineering blog posts about Rest.li:
http://engineering.linkedin.com/architecture/restli-restful-service-
architecture-scale http://engineering.linkedin.com/restli/linkedins-restli-
moment
● LinkedIn’s GitHub projects http://linkedin.github.io/
43
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/linkedin-
microservices-urn

More Related Content

More from C4Media

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
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsC4Media
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechC4Media
 

More from C4Media (20)

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
 
Navigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery TeamsNavigating Complexity: High-performance Delivery and Discovery Teams
Navigating Complexity: High-performance Delivery and Discovery Teams
 
High Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in AdtechHigh Performance Cooperative Distributed Systems in Adtech
High Performance Cooperative Distributed Systems in Adtech
 

Recently uploaded

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

From a Monolith to Microservices + REST: the Evolution of LinkedIn's Service Architecture

  • 1. From a monolith to microservices + REST The evolution of LinkedIn’s service architecture by Steven Ihde and Karan Parikh (LinkedIn)
  • 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 /linkedin-microservices-urn
  • 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.
  • 5.
  • 6. Leo ● Our original codebase ● Java, Servlets, JSP, JDBC Leo Oracle 4
  • 7. Remote Graph ● Graph: member-to-member connection graph ● Complex graph traversal problems not suited to SQL queries ● RPC was used to keep it separate from Leo ● Our first service 5
  • 9. Mid/Back Tier Services ● “Back” tier services encapsulate data domains ● “Mid” tier services provide business logic ● We applied the service pattern to many domains, e.g. member profiles, job postings, group postings 7
  • 10. Front Tier Services ● “Front” tier services aggregate data from many domains ● Transform the data through templates to present to the client ● Should be stateless for scaling purposes 8
  • 11. Service Explosion ● Over 100 services by 2010 ● Most new development occurring in services, not Leo ● Site release every two weeks 9
  • 12. Architectural Challenges ● Test failures ● Incompatibilities ● Complex orchestration ● Rollback difficult or impossible ● Complex dependencies between services 10
  • 13. Microservices? ● Services were fine grained ● But monolithic build and release process did not allow us to realize the benefits of microservice architecture 11
  • 14. Solutions ● Continuous delivery ● Break apart the code base ● Devolution of control ● Strict backwards compatibility ● Better defined boundaries between tiers 12
  • 15. Continuous Delivery ● Shared trunk ● Pre- and post-commit automated testing ● Easy promotion of builds to production environment 13
  • 16. Decentralize Codebase ● Separate, independently buildable repositories ● Shared trunk within each repository ● Versioned binary dependencies between repositories 14
  • 17. Devolution of Control ● Service owners control release schedule, release criteria ● Service owners are responsible for backwards compatibility ● Services must release independently 15
  • 18. Backwards compatibility ● Insulates teams from each other at runtime ● Allows service owners to deploy on their own schedule without impacting clients 16
  • 19. Boundaries Between Tiers ● Limit aggregation to the front tier ● Limit crosstalk in the back tier: “superblocks” 17
  • 21. Java RPC ● Difficult to maintain backwards compatibility ● Verb-centric APIs ● Use case specific APIs ● Difficult to navigate the proliferation of APIs 19
  • 22. Rest.li plus Deco equals Microservices at LinkedIn
  • 23. What is Rest.li? “Rest.li is an open source REST framework for building robust, scalable RESTful architectures using type-safe bindings and asynchronous, non-blocking I/O.” Primarily JSON over HTTP. 21
  • 24. Why Rest.li? ● Polyglot (frontend) ecosystem - Java, Scala, Python, Node.js, Objective-C ● Uniform service interfaces (REST) 22
  • 25. The Rest.li stack Rest.li Data layer and RESTful operations D2 Dynamic discovery and load balancing R2 Network Communication 23
  • 26. Request Response (R2) ● REST abstraction that can send messages over any application layer protocol (HTTP, PRPC (old custom LinkedIn protocol)) ● Client - fully asynchronous Netty ● Server - Jetty, Netty (experimental) Rest.li D2 R2 24
  • 27. Dynamic Discovery (D2) ● Apache ZooKeeper ● Dynamic server discovery ● Client side software load balancing ● D2 service Rest.li R2 D2 25
  • 28. Rest.li ● Data using PDSCs (Pegasus Data Schemas) ● RESTful API that developers use to build services ● CRUD + finders + actions ● API and data backwards compatibility checking R2 D2 Rest.li 26
  • 29. 830 Rest.li resources. 90 billion Rest.li calls/day across multiple datacenters. 65% service-to-service calls.
  • 31. Aside: Normalized Domain Models ● Links over inclusion (denormalization) ● URNs are fully qualified foreign keys InfluencerPost Long id String title String content URN author Member Long id String firstName String lastName String summary URN company 29
  • 32. What is Deco? ● URN resolution library ● What data you want, not how you want it Time 1 2 3 30
  • 33. Deco Example: Influencer Post Dummy Post by Karan Parikh at LinkedIn Hi QCon! /influencerPosts /influencerPosts /companies /profiles 31
  • 34. Deco Example: Influencer Post deco://influencerPosts/123?projection=(title, content, author~(firstName, lastName, company~(companyName))) 32
  • 36. Rest.li plus Deco equals Microservices at LinkedIn
  • 37. How Rest.li enables Microservices ● Rest.li + D2 facilitate domain specific services ● Services can easily configure clients via D2 ● D2 helps us scale the architecture 35
  • 38. How Deco enables Microservices ● Deals with service explosion ● Abstracts away services from clients 36
  • 39. Challenges ● Coordinating a massive engineering effort. (LiX to the rescue!) ● Ensuring uniform RESTful interfaces ● Performance Rest.li API Hub37
  • 40. Wins ● All languages talk to the same service ● Developer productivity ● Reduction of hardware load balancers ● Ability to expose APIs directly to third parties 38
  • 41.
  • 42.
  • 45. References and links ● Rest.li: http://rest.li/ ● Rest.li API Hub: https://github.com/linkedin/rest.li-api-hub ● Rest.li user guide: https://github.com/linkedin/rest.li/wiki/Rest.li-User-Guide ● Modeling resources with Rest.li: https://github.com/linkedin/rest.li/wiki/Modeling-Resources-with-Rest.li ● LinkedIn engineering blog posts about Rest.li: http://engineering.linkedin.com/architecture/restli-restful-service- architecture-scale http://engineering.linkedin.com/restli/linkedins-restli- moment ● LinkedIn’s GitHub projects http://linkedin.github.io/ 43
  • 46. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/linkedin- microservices-urn