Professional Documents
Culture Documents
A BRIEF HISTORY
Josh Clemm
www.linkedin.com/in/joshclemm
400M
400M
350M
300M
250M
200M
150M
100M
50M
32M
0M
2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015
the beginning
LEO
DB
LEO
LEO
DB
MEMBER SEARCH
Social networks need powerful search
Lucene was used on top of our member graph
MEMBER SEARCH
Social networks need powerful search
Lucene was used on top of our member graph
LEO
RPC
Member
Graph
Lucene
DB
Circa 2004
REPLICA DBs
Master/slave concept
Read-only traffic from replica
Writes go to main DB
Early version of Databus kept DBs in sync
Main DB
Databus
relay
Replica
Replica
Replica DB
Main DB
Databus
relay
Replica
Replica
Replica DB
RPC
LEO
R/O
R/W
Main DB
Member
Graph
Connection
Updates
Databus relay
Search
Profile
Updates
Replica
Replica
Replica
DB
Circa 2006
Kill LEO
Public Profile
Web App
LEO
Profile Service
Yet another
Service
Circa 2008 on
Profile Web
App
Profile
Service
Profile DB
Frontend
Web App
Profile
Mid-tier
Content
Service
Service
Connections
Mid-tier
Content
Service
Service
Groups
Mid-tier
Content
Service
Service
Edu
Data
Data
Service
Kafka
Service
DB
Voldemort
Hadoop
PROS
Stateless services
easily scale
CONS
Ops overhead
Decoupled domains
Introduces backwards
compatibility issues
SERVICES AT LINKEDIN
In 2003, LinkedIn had one service (Leo)
By 2010, LinkedIn had over 150 services
Today in 2015, LinkedIn has over 750 services
CACHING
Frontend
Web App
Mid-tier
Service
Cache
Cache
DB
There are only two hard problems in
Computer Science:
Cache invalidation, naming things, and
off-by-one errors.
CACHING TAKEAWAYS
Caches are easy to add in the beginning, but
complexity adds up over time.
Over time LinkedIn removed many mid-tier
caches because of the complexity around
invalidation
We kept caches closer to data layer
KAFKA MOTIVATIONS
LinkedIn generates a ton of data
Pageviews
Edits on profile, companies, schools
Logging, timing
Invites, messaging
Tracking
Billions of events everyday
Separate and independently created pipelines
routed this data
KAFKA
Distributed pub-sub messaging platform as LinkedIns
universal data pipeline
Frontend
service
Frontend
service
Backend
Service
Kafka
DWH
Oracle
Monitoring
Analytics
Hadoop
KAFKA AT LINKEDIN
BENEFITS
Enabled near realtime access to any data source
Empowered Hadoop jobs
Allowed LinkedIn to build realtime analytics
Vastly improved site monitoring capability
Enabled devs to visualize and track call graphs
Over 1 trillion messages published per day, 10 million
messages per second
IL
Y
A
D
ILY
A
D
D
E
H
D
E
IS
H
L
B
IS
U
L
P
B
U
N
P
IO
ILLLION
RIL
R 11 TTR
O
ER
VE
OV
REST.LI
Services extracted from Leo or created new
were inconsistent and often tightly coupled
Rest.li was our move to a data model centric
architecture
It ensured a consistent stateless Restful API
model across the company.
REST.LI (cont.)
By using JSON over HTTP, our new APIs
supported non-Java-based clients.
By using Dynamic Discovery (D2), we got
load balancing, discovery, and scalability of
each service API.
Today, LinkedIn has 1130+ Rest.li resources
and over 100 billion Rest.li calls per day
REST.LI (cont.)
REST.LI (cont.)
DATA INFRASTRUCTURE
It was clear LinkedIn could build data
infrastructure that enables long term growth
LinkedIn doubled down on infra solutions like:
Storage solutions
Espresso, Voldemort, Ambry (media)
Analytics solutions like Pinot
Streaming solutions
Kafka, Databus, and Samza
Cloud solutions like Helix and Nuage
DATABUS
Hofstadter's Law: It always takes longer
than you expect, even when you take
into account Hofstadter's Law.
THANKS!
Josh Clemm
www.linkedin.com/in/joshclemm
LEARN MORE
Blog version of this slide deck
https://engineering.linkedin.com/architecture/brief-history-scaling-linkedin
LinkedIn Open-Source
https://engineering.linkedin.com/open-source
Profile
http://engineering.linkedin.com/profile/engineering-new-linkedin-profile
Play Framework
Introduction at LinkedIn https://engineering.linkedin.
com/play/composable-and-streamable-play-apps
System tuning
http://engineering.linkedin.com/performance/optimizing-linux-memory-managementlow-latency-high-throughput-databases
WERE HIRING
LinkedIn continues to grow quickly and theres
still a ton of work we can do to improve.
Were working on problems that very few ever
get to solve - come join us!