SlideShare a Scribd company logo
1 of 41
Download to read offline
LINKEDIN COMMUNICATION ARCHITECTURE
Ruslan Belkin, Sean Dawson
TS-5234
2008 JavaOneSM
Conference | java.sun.com/javaone | 2
Learn how we at LinkedIn built and evolved scalable
communication platform for the world’s largest
professional network
2008 JavaOneSM
Conference | java.sun.com/javaone | 3
Agenda
Why are we doing this talk
LinkedIn Communication Platform at a glance
• Evolution of LinkedIn Communication System
• Evolution of the Network Updates System
Scaling the system: from 0 to 22M members
Q&A
2008 JavaOneSM
Conference | java.sun.com/javaone | 4
Why are we doing this talk?
Share our experience in building the world-largest
professional network in Java™
Describe the evolution of the communication platform
Share lessons we learned so you could benefit from our
successes, mistakes and experience
2008 JavaOneSM
Conference | java.sun.com/javaone | 5
LinkedIn Communication Platform
Quick Tour
2008 JavaOneSM
Conference | java.sun.com/javaone | 6
LinkedIn Communication Platform
Quick Tour
2008 JavaOneSM
Conference | java.sun.com/javaone | 7
LinkedIn Communication Platform
Quick Tour
2008 JavaOneSM
Conference | java.sun.com/javaone | 8
LinkedIn Communication Platform
The Numbers
22M members
130M connections
2M email messages per day
250K invitations per day
2008 JavaOneSM
Conference | java.sun.com/javaone | 9
LinkedIn Communication Platform
The Setup
Sun™ x86 platform and Sparc production hardware
running Solaris™ Operating System
100% Java programming language
Tomcat and Jetty as application servers
Oracle and MySQL as DBs
ActiveMQ for JMS
Lucene as a foundation for search
Spring as a glue
Mac for development
2008 JavaOneSM
Conference | java.sun.com/javaone | 10
LinkedIn Communication Platform
The Communication Service
• Permanent message storage
• InBox messages
• Emails
• Batching, delayed delivery
• Bounce, cancellation
• Actionable content
• Rich email content
The network updates service
• Short-lived notifications (events)
• Distribution across various
affiliations and groups
• Time decay
• Events grouping and
prioritization
2008 JavaOneSM
Conference | java.sun.com/javaone | 11
The Communication Service
How is it different:
• Workflow oriented
• Messages reference other objects in the system
• Incorporates email delivery
• Batching of messages
• Message cancellation
• Delayed delivery, customer service review queues, abuse controls
• Supports reminders and bounce notifications to users
Has undergone continuous improvements throughout life
of LinkedIn
2008 JavaOneSM
Conference | java.sun.com/javaone | 12
Message Creation
2008 JavaOneSM
Conference | java.sun.com/javaone | 13
Message Delivery
2008 JavaOneSM
Conference | java.sun.com/javaone | 14
The Communication Service
Message Creation
• Clients post messages via
asynchronous Java Communications
API using JMS
• Messages then are routed via
routing service to the appropriate
mailbox or directly for email
processing
• Multiple member or guest
databases are supported
Message Delivery
• Message delivery is triggered by
clients or by scheduled processes
• Delivery actions are asynchronous
• Messages can be batched for
delivery into a single email message
• Message content is processed
through the JavaServer Page™ (JSP™)
technology for pretty formatting
• The scheduler can take into account
the time, delivery preferences,
system load
• Bounced messages are processed
and redelivered if needed
• Reminder system works the same
way as message delivery system
2008 JavaOneSM
Conference | java.sun.com/javaone | 15
The Communication Service
SOA architecture
Wireable components build around LinkedIn Spring
extensions
Spring HTTP-RPC
Heavy use of JMS and asynchronous flows
2008 JavaOneSM
Conference | java.sun.com/javaone | 16
The Communication Service
Failure Recovery
Possible failures:
• Messages can bounce
• Messages can get lost:
• Database problems
• Bugs in the code
• Bugs in the content processing of emails
• Various services may become unavailable
Avoiding the downtime
2008 JavaOneSM
Conference | java.sun.com/javaone | 17
The Communication Service
How do we scale it?
Functional partitioning:
• sent, received, archived, etc.
Class partitioning:
• Member mailboxes, guest mailboxes, corporate mailboxes
Range partitioning:
• Member ID range
• Email lexicographical range
Asynchronous flows
2008 JavaOneSM
Conference | java.sun.com/javaone | 18
Network Updates Service
What is your network up to?
The goal is to have a flexible service for distributing many
types of short-lived updates
Availability across a number of clients (web apps, RSS,
API, LinkedIn Mobile, third-party…)
2008 JavaOneSM
Conference | java.sun.com/javaone | 19
Network Updates Service
Motivation
Homepage circa 2007
Poor UI
• Cluttered
• Where does new content go?
Poor Backend Integration
• Many different service calls
• Takes a long time to gather all
of the data
2008 JavaOneSM
Conference | java.sun.com/javaone | 20
Network Updates Service
Motivation
Homepage circa 2008
Clean UI
• Eliminates contention for
homepage real estate
Clean Backend
• Single call to fetch updates
• Consistent update format
2008 JavaOneSM
Conference | java.sun.com/javaone | 21
Network Updates Service
Iteration 1
Move existing homepage logic into a remote service,
refactor homepage to use the new service
Advantages
• No user impact while API is being finalized
• Improve performance by fetching updates in parallel
• Reduce complexity of the web app
• Updates become easily accessible to other clients
2008 JavaOneSM
Conference | java.sun.com/javaone | 22
Network Updates Service
Iteration 1 - API
2008 JavaOneSM
Conference | java.sun.com/javaone | 23
Network Updates Service
Iteration 1 - API
Pull-based architecture
Collectors
• Responsible for gathering data
• Parallel collection to improve performance
Resolvers
• Fetch state, batch lookup queries, etc…
• Use EHCache to cache global data (e.g., member info)
Rendering
• Transform each object into its XML representation
2008 JavaOneSM
Conference | java.sun.com/javaone | 24
Network Updates Service
Iteration 1 - Example
UpdateQueryCriteria query =
UpdateQueryCriteria.createDefaultCriteria()
.setMemberID(2)
.setRequestedTypes(NetworkUpdateType.CONNECTION)
.setCutoffDate(…)
.setMaxNumberOfUpdates(10);
MyNetworkUpdatesService service =
getService(MyNetworkUpdatesService.class);
DataTree update =
service.getNetworkUpdatesSumary(query);
2008 JavaOneSM
Conference | java.sun.com/javaone | 25
Network Updates Service
Iteration 1 - Example
<updates>
<NCON>
<connection>
<id>2</id>
<firstName>Chris</firstNa
me>
<lastName>Yee</lastName>
</connection>
</NCON>
</updates>
2008 JavaOneSM
Conference | java.sun.com/javaone | 26
Network Updates Service
Iteration 1
Lessons learned:
• Centralizing updates into a single service leaves a single point of
failure
• Be prepared to spend time tuning the HttpConnectionManager
(timeouts, max connections)
• While the system was stabilizing, it was affecting all users; should
have rolled the new service out to a small subset!
• Don’t use “Least Frequently Used” (LFU) in a large EHCache—very
bad performance!
2008 JavaOneSM
Conference | java.sun.com/javaone | 27
Network Updates Service
Iteration 2
Hollywood Principle: “Don’t call me, I’ll call you”
Push update when an event occurs
Reading is much quicker since we don’t have to search for
the data!
Tradeoffs
• Distributed updates may never be read
• More storage space needed
2008 JavaOneSM
Conference | java.sun.com/javaone | 28
Network Updates Service
Iteration 2 - Pushing Events
2008 JavaOneSM
Conference | java.sun.com/javaone | 29
Network Updates Service
Iteration 2 - Reading Updates
2008 JavaOneSM
Conference | java.sun.com/javaone | 30
Network Updates Service
Iteration 2
Pushing Updates
• Updates are delivered via JMS
• Aggregate data stored in 1 CLOB column for each target user
• Incoming updates are merged into the aggregate structure using
optimistic locking to avoid lock contention
Reading Updates
• Add a new collector that reads from the Update Database
• Use Digesters to perform arbitrary transformations on the stream
of updates (e.g, collapse 10 updates from a user into 1)
2008 JavaOneSM
Conference | java.sun.com/javaone | 31
Network Updates Service
Iteration 2
Lessons learned:
• Underestimated the volume of updates to be processed
• CLOB block size was set to 8k, leading to a lot of wasted space
(which isn’t reclaimed!)
• Real-time monitoring/configuration with Java Management
Extension (JMX™) specification was extremely helpful
2008 JavaOneSM
Conference | java.sun.com/javaone | 32
Network Updates Service
Iteration 3
Updating a CLOB is expensive
Goal: Minimize the number of CLOB updates
• Use an overflow buffer
• Reduce the size of the updates
2008 JavaOneSM
Conference | java.sun.com/javaone | 33
Network Updates Service
Iteration 3 - Overflow Buffer
Add VARCHAR(4000) column
that acts as a buffer
When the buffer is full, dump it
to the CLOB and reset
Avoids over 90% of CLOB
updates (depending on type),
while still retaining the
flexibility for more storage
2008 JavaOneSM
Conference | java.sun.com/javaone | 34
Scaling the system
What you learn as you scale:
• A single database does not work
• Referential integrity will not be
possible
• Cost becomes a factor:
databases, hardware, licenses,
storage, power
• Any data loss is a problem
• Data warehousing and analytics
becomes a problem
• Your system becomes a target
for spamming exploits, data
scraping, etc.
What to do:
• Partition everything:
• by user groups
• by domain
• by function
• Caching is good even when it’s
only modestly effective
• Give up on 100% data integrity
• Build for asynchronous flows
• Build with reporting in mind
• Expect your system to fail at any
point
• Never underestimate growth
trajectory
2008 JavaOneSM
Conference | java.sun.com/javaone | 35
LinkedIn Communication Architecture
Build with scalability in mind - never know when your
business will take off
Expect to do a lot of architecture and code refactoring as
you learn and appreciate growth challenges
LinkedIn Communication Architecture
Ruslan Belkin (http://www.linkedin.com/in/rbelkin)
Sean Dawson (http://www.linkedin.com/in/seandawson)
We are hiring!
2008 JavaOneSM
Conference | java.sun.com/javaone | 37
The Communication Service
LinkedIn Spring Extensions
Automatic context instantiation
from multiple spring files
LinkedIn Spring Components
Property expansion
Automatic termination handling
Support for Builder Pattern
Custom property editors:
• Timespan (30s, 4h34m, etc.)
• Memory Size, etc.
2008 JavaOneSM
Conference | java.sun.com/javaone | 38
Comm-server/
cmpt/
components/
ccsServiceExporter.spring
comm.spring
jmx.spring
comm-server.properties
corpMboxServiceExporter.spring
main.spring
comm-server.spring
memberMboxServiceExporter.spring
comm.properties
guestMboxServiceExporter.spring
build.xml
impl/
…
The Communication Service
LinkedIn Spring Extensions
2008 JavaOneSM
Conference | java.sun.com/javaone | 39
…
<bean id="resolver”
class="com.linkedin.comm.pub.impl.MessageAddressResolver">
<lin:config>
<property name="resolverDB" ref="resolverDB"/>
<property name="eos" ref="eos"/>
<property name="els" ref="eos"/>
<property name="memberAccessor"
ref="coreMemberAccessor"/>
</lin:config>
</bean>
…
The Communication Service
LinkedIn Spring Extensions
2008 JavaOneSM
Conference | java.sun.com/javaone | 40
private final MessageAddressResolverDB _resolverDB;
…
MessageAddressResolver(Config config) { … }
…
public static class Config {
private MessageAddressResolverDB _resolverDB;
public MessageAddressResolverDB getResolverDB() {
return ConfigHelper.getRequired(_resolverDB);
}
public void setResolverDB(MessageAddressResolverDB
resolverDB) {
_resolverDB = resolverDB;
}
}/*Config*/
The Communication Service
LinkedIn Spring Extensions (Builder)
2008 JavaOneSM
Conference | java.sun.com/javaone | 41
…
<lin:component
id="remoteContentCommunicationService"
location="comm-server-client-cmpt">
<lin:wire property-name="activemq.producer.brokerURL"
property-
value="${activemq.producer.brokerURL}"/>
<lin:wire property-name="comm.server.httpRpc.url"
property-
value="${leo.comm.server.httpRpc.url}"/>
</lin:component>
…
The Communication Service
LinkedIn Spring Extensions (Components)

More Related Content

What's hot

Blug connections
Blug connectionsBlug connections
Blug connectionsWannes Rams
 
Microsoft Windows 7 Improved Network Access
Microsoft Windows 7 Improved Network AccessMicrosoft Windows 7 Improved Network Access
Microsoft Windows 7 Improved Network AccessMicrosoft TechNet
 
ClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCMClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCMIBM Rational software
 
Sql dba and msbi placement training usa
Sql dba and msbi placement training usaSql dba and msbi placement training usa
Sql dba and msbi placement training usasssql
 
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...Nicolas Henry
 
Classloader leak detection in websphere application server
Classloader leak detection in websphere application serverClassloader leak detection in websphere application server
Classloader leak detection in websphere application serverRohit Kelapure
 
Web Sphere Administration guide – Packaging and Deploying Jee Applications
Web Sphere Administration guide – Packaging and Deploying Jee ApplicationsWeb Sphere Administration guide – Packaging and Deploying Jee Applications
Web Sphere Administration guide – Packaging and Deploying Jee ApplicationsGagandeep Singh
 
W23 - Advanced Performance Tactics for WebSphere Performance
W23 - Advanced Performance Tactics for WebSphere PerformanceW23 - Advanced Performance Tactics for WebSphere Performance
W23 - Advanced Performance Tactics for WebSphere PerformanceHendrik van Run
 
Was liberty in deployments
Was liberty in deploymentsWas liberty in deployments
Was liberty in deploymentssflynn073
 
Live sql server 2012 dba online training
Live sql server 2012 dba online trainingLive sql server 2012 dba online training
Live sql server 2012 dba online trainingsssql
 
Sql server 2012 dba online training
Sql server 2012 dba online trainingSql server 2012 dba online training
Sql server 2012 dba online trainingsssql
 
Online sql dba training
Online sql dba trainingOnline sql dba training
Online sql dba trainingssmasters
 
IBM WebSphere application server
IBM WebSphere application serverIBM WebSphere application server
IBM WebSphere application serverIBM Sverige
 
High Scalability by Example – How can Web-Architecture scale like Facebook, T...
High Scalability by Example – How can Web-Architecture scale like Facebook, T...High Scalability by Example – How can Web-Architecture scale like Facebook, T...
High Scalability by Example – How can Web-Architecture scale like Facebook, T...Robert Mederer
 
Microsoft Offical Course 20410C_00
Microsoft Offical Course 20410C_00Microsoft Offical Course 20410C_00
Microsoft Offical Course 20410C_00gameaxt
 
DistributedMediaApplicationProject
DistributedMediaApplicationProjectDistributedMediaApplicationProject
DistributedMediaApplicationProjectLakshmi Sreejith
 

What's hot (20)

Blug connections
Blug connectionsBlug connections
Blug connections
 
Microsoft Windows 7 Improved Network Access
Microsoft Windows 7 Improved Network AccessMicrosoft Windows 7 Improved Network Access
Microsoft Windows 7 Improved Network Access
 
ClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCMClearCase Version Importer - a migration tool to Rational Team Concert SCM
ClearCase Version Importer - a migration tool to Rational Team Concert SCM
 
Sql dba and msbi placement training usa
Sql dba and msbi placement training usaSql dba and msbi placement training usa
Sql dba and msbi placement training usa
 
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...
How to Stabilise and Improve an SAP BusinessObjects BI 4.2 Enterprise Shared ...
 
Classloader leak detection in websphere application server
Classloader leak detection in websphere application serverClassloader leak detection in websphere application server
Classloader leak detection in websphere application server
 
Web Sphere Administration guide – Packaging and Deploying Jee Applications
Web Sphere Administration guide – Packaging and Deploying Jee ApplicationsWeb Sphere Administration guide – Packaging and Deploying Jee Applications
Web Sphere Administration guide – Packaging and Deploying Jee Applications
 
W23 - Advanced Performance Tactics for WebSphere Performance
W23 - Advanced Performance Tactics for WebSphere PerformanceW23 - Advanced Performance Tactics for WebSphere Performance
W23 - Advanced Performance Tactics for WebSphere Performance
 
Was liberty in deployments
Was liberty in deploymentsWas liberty in deployments
Was liberty in deployments
 
Live sql server 2012 dba online training
Live sql server 2012 dba online trainingLive sql server 2012 dba online training
Live sql server 2012 dba online training
 
Sql server 2012 dba online training
Sql server 2012 dba online trainingSql server 2012 dba online training
Sql server 2012 dba online training
 
Online sql dba training
Online sql dba trainingOnline sql dba training
Online sql dba training
 
IBM WebSphere application server
IBM WebSphere application serverIBM WebSphere application server
IBM WebSphere application server
 
Mcsa certification 410
Mcsa certification 410Mcsa certification 410
Mcsa certification 410
 
Resume
ResumeResume
Resume
 
High Scalability by Example – How can Web-Architecture scale like Facebook, T...
High Scalability by Example – How can Web-Architecture scale like Facebook, T...High Scalability by Example – How can Web-Architecture scale like Facebook, T...
High Scalability by Example – How can Web-Architecture scale like Facebook, T...
 
Microsoft Offical Course 20410C_00
Microsoft Offical Course 20410C_00Microsoft Offical Course 20410C_00
Microsoft Offical Course 20410C_00
 
DistributedMediaApplicationProject
DistributedMediaApplicationProjectDistributedMediaApplicationProject
DistributedMediaApplicationProject
 
20410 b 00
20410 b 0020410 b 00
20410 b 00
 
Quickr
QuickrQuickr
Quickr
 

Similar to JavaOne Conference, 2008

LinkedIn Communication Architecture
LinkedIn Communication ArchitectureLinkedIn Communication Architecture
LinkedIn Communication ArchitectureLinkedIn
 
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates UncoveredRuslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates UncoveredLinkedIn
 
Server side push in Aldan 3
Server side push in Aldan 3Server side push in Aldan 3
Server side push in Aldan 3ALDAN3
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Markus Eisele
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EEJ On The Beach
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EEMarkus Eisele
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxPINGXIONG3
 
O'Reilly Velocity Conference 2008
O'Reilly Velocity Conference 2008O'Reilly Velocity Conference 2008
O'Reilly Velocity Conference 2008Sean Dawson
 
LinkedIn - A highly scalable Architecture on Java!
LinkedIn - A highly scalable Architecture on Java!LinkedIn - A highly scalable Architecture on Java!
LinkedIn - A highly scalable Architecture on Java!manivannan57
 
170215 msa intro
170215 msa intro170215 msa intro
170215 msa introSonic leigh
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2sandeep54552
 
enterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdfenterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdfEidTahir
 
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011Diameter progress, popular use cases, roadmap - Mobicents Summit 2011
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011telestax
 
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONSADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONSelliando dias
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...Nick Dellamaggiore
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackC4Media
 
Linkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesLinkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesruslansv
 

Similar to JavaOne Conference, 2008 (20)

LinkedIn Communication Architecture
LinkedIn Communication ArchitectureLinkedIn Communication Architecture
LinkedIn Communication Architecture
 
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates UncoveredRuslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
Ruslan Belkin And Sean Dawson on LinkedIn's Network Updates Uncovered
 
Server side push in Aldan 3
Server side push in Aldan 3Server side push in Aldan 3
Server side push in Aldan 3
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19
 
Streaming to a New Jakarta EE
Streaming to a New Jakarta EEStreaming to a New Jakarta EE
Streaming to a New Jakarta EE
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptx
 
O'Reilly Velocity Conference 2008
O'Reilly Velocity Conference 2008O'Reilly Velocity Conference 2008
O'Reilly Velocity Conference 2008
 
LinkedIn - A highly scalable Architecture on Java!
LinkedIn - A highly scalable Architecture on Java!LinkedIn - A highly scalable Architecture on Java!
LinkedIn - A highly scalable Architecture on Java!
 
170215 msa intro
170215 msa intro170215 msa intro
170215 msa intro
 
Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2Enterprise java unit-1_chapter-2
Enterprise java unit-1_chapter-2
 
enterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdfenterprisejavaunit-1chapter-2-210914075956.pdf
enterprisejavaunit-1chapter-2-210914075956.pdf
 
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011Diameter progress, popular use cases, roadmap - Mobicents Summit 2011
Diameter progress, popular use cases, roadmap - Mobicents Summit 2011
 
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONSADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS
ADDRESSING TOMORROW'S SECURITY REQUIREMENTS IN ENTERPRISE APPLICATIONS
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
 
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
LinkedIn - A Professional Network built with Java Technologies and Agile Prac...
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes Back
 
Introduction to weblogic
Introduction to weblogicIntroduction to weblogic
Introduction to weblogic
 
Linkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slidesLinkedin NUS QCon 2009 slides
Linkedin NUS QCon 2009 slides
 

Recently uploaded

Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 

JavaOne Conference, 2008

  • 1. LINKEDIN COMMUNICATION ARCHITECTURE Ruslan Belkin, Sean Dawson TS-5234
  • 2. 2008 JavaOneSM Conference | java.sun.com/javaone | 2 Learn how we at LinkedIn built and evolved scalable communication platform for the world’s largest professional network
  • 3. 2008 JavaOneSM Conference | java.sun.com/javaone | 3 Agenda Why are we doing this talk LinkedIn Communication Platform at a glance • Evolution of LinkedIn Communication System • Evolution of the Network Updates System Scaling the system: from 0 to 22M members Q&A
  • 4. 2008 JavaOneSM Conference | java.sun.com/javaone | 4 Why are we doing this talk? Share our experience in building the world-largest professional network in Java™ Describe the evolution of the communication platform Share lessons we learned so you could benefit from our successes, mistakes and experience
  • 5. 2008 JavaOneSM Conference | java.sun.com/javaone | 5 LinkedIn Communication Platform Quick Tour
  • 6. 2008 JavaOneSM Conference | java.sun.com/javaone | 6 LinkedIn Communication Platform Quick Tour
  • 7. 2008 JavaOneSM Conference | java.sun.com/javaone | 7 LinkedIn Communication Platform Quick Tour
  • 8. 2008 JavaOneSM Conference | java.sun.com/javaone | 8 LinkedIn Communication Platform The Numbers 22M members 130M connections 2M email messages per day 250K invitations per day
  • 9. 2008 JavaOneSM Conference | java.sun.com/javaone | 9 LinkedIn Communication Platform The Setup Sun™ x86 platform and Sparc production hardware running Solaris™ Operating System 100% Java programming language Tomcat and Jetty as application servers Oracle and MySQL as DBs ActiveMQ for JMS Lucene as a foundation for search Spring as a glue Mac for development
  • 10. 2008 JavaOneSM Conference | java.sun.com/javaone | 10 LinkedIn Communication Platform The Communication Service • Permanent message storage • InBox messages • Emails • Batching, delayed delivery • Bounce, cancellation • Actionable content • Rich email content The network updates service • Short-lived notifications (events) • Distribution across various affiliations and groups • Time decay • Events grouping and prioritization
  • 11. 2008 JavaOneSM Conference | java.sun.com/javaone | 11 The Communication Service How is it different: • Workflow oriented • Messages reference other objects in the system • Incorporates email delivery • Batching of messages • Message cancellation • Delayed delivery, customer service review queues, abuse controls • Supports reminders and bounce notifications to users Has undergone continuous improvements throughout life of LinkedIn
  • 12. 2008 JavaOneSM Conference | java.sun.com/javaone | 12 Message Creation
  • 13. 2008 JavaOneSM Conference | java.sun.com/javaone | 13 Message Delivery
  • 14. 2008 JavaOneSM Conference | java.sun.com/javaone | 14 The Communication Service Message Creation • Clients post messages via asynchronous Java Communications API using JMS • Messages then are routed via routing service to the appropriate mailbox or directly for email processing • Multiple member or guest databases are supported Message Delivery • Message delivery is triggered by clients or by scheduled processes • Delivery actions are asynchronous • Messages can be batched for delivery into a single email message • Message content is processed through the JavaServer Page™ (JSP™) technology for pretty formatting • The scheduler can take into account the time, delivery preferences, system load • Bounced messages are processed and redelivered if needed • Reminder system works the same way as message delivery system
  • 15. 2008 JavaOneSM Conference | java.sun.com/javaone | 15 The Communication Service SOA architecture Wireable components build around LinkedIn Spring extensions Spring HTTP-RPC Heavy use of JMS and asynchronous flows
  • 16. 2008 JavaOneSM Conference | java.sun.com/javaone | 16 The Communication Service Failure Recovery Possible failures: • Messages can bounce • Messages can get lost: • Database problems • Bugs in the code • Bugs in the content processing of emails • Various services may become unavailable Avoiding the downtime
  • 17. 2008 JavaOneSM Conference | java.sun.com/javaone | 17 The Communication Service How do we scale it? Functional partitioning: • sent, received, archived, etc. Class partitioning: • Member mailboxes, guest mailboxes, corporate mailboxes Range partitioning: • Member ID range • Email lexicographical range Asynchronous flows
  • 18. 2008 JavaOneSM Conference | java.sun.com/javaone | 18 Network Updates Service What is your network up to? The goal is to have a flexible service for distributing many types of short-lived updates Availability across a number of clients (web apps, RSS, API, LinkedIn Mobile, third-party…)
  • 19. 2008 JavaOneSM Conference | java.sun.com/javaone | 19 Network Updates Service Motivation Homepage circa 2007 Poor UI • Cluttered • Where does new content go? Poor Backend Integration • Many different service calls • Takes a long time to gather all of the data
  • 20. 2008 JavaOneSM Conference | java.sun.com/javaone | 20 Network Updates Service Motivation Homepage circa 2008 Clean UI • Eliminates contention for homepage real estate Clean Backend • Single call to fetch updates • Consistent update format
  • 21. 2008 JavaOneSM Conference | java.sun.com/javaone | 21 Network Updates Service Iteration 1 Move existing homepage logic into a remote service, refactor homepage to use the new service Advantages • No user impact while API is being finalized • Improve performance by fetching updates in parallel • Reduce complexity of the web app • Updates become easily accessible to other clients
  • 22. 2008 JavaOneSM Conference | java.sun.com/javaone | 22 Network Updates Service Iteration 1 - API
  • 23. 2008 JavaOneSM Conference | java.sun.com/javaone | 23 Network Updates Service Iteration 1 - API Pull-based architecture Collectors • Responsible for gathering data • Parallel collection to improve performance Resolvers • Fetch state, batch lookup queries, etc… • Use EHCache to cache global data (e.g., member info) Rendering • Transform each object into its XML representation
  • 24. 2008 JavaOneSM Conference | java.sun.com/javaone | 24 Network Updates Service Iteration 1 - Example UpdateQueryCriteria query = UpdateQueryCriteria.createDefaultCriteria() .setMemberID(2) .setRequestedTypes(NetworkUpdateType.CONNECTION) .setCutoffDate(…) .setMaxNumberOfUpdates(10); MyNetworkUpdatesService service = getService(MyNetworkUpdatesService.class); DataTree update = service.getNetworkUpdatesSumary(query);
  • 25. 2008 JavaOneSM Conference | java.sun.com/javaone | 25 Network Updates Service Iteration 1 - Example <updates> <NCON> <connection> <id>2</id> <firstName>Chris</firstNa me> <lastName>Yee</lastName> </connection> </NCON> </updates>
  • 26. 2008 JavaOneSM Conference | java.sun.com/javaone | 26 Network Updates Service Iteration 1 Lessons learned: • Centralizing updates into a single service leaves a single point of failure • Be prepared to spend time tuning the HttpConnectionManager (timeouts, max connections) • While the system was stabilizing, it was affecting all users; should have rolled the new service out to a small subset! • Don’t use “Least Frequently Used” (LFU) in a large EHCache—very bad performance!
  • 27. 2008 JavaOneSM Conference | java.sun.com/javaone | 27 Network Updates Service Iteration 2 Hollywood Principle: “Don’t call me, I’ll call you” Push update when an event occurs Reading is much quicker since we don’t have to search for the data! Tradeoffs • Distributed updates may never be read • More storage space needed
  • 28. 2008 JavaOneSM Conference | java.sun.com/javaone | 28 Network Updates Service Iteration 2 - Pushing Events
  • 29. 2008 JavaOneSM Conference | java.sun.com/javaone | 29 Network Updates Service Iteration 2 - Reading Updates
  • 30. 2008 JavaOneSM Conference | java.sun.com/javaone | 30 Network Updates Service Iteration 2 Pushing Updates • Updates are delivered via JMS • Aggregate data stored in 1 CLOB column for each target user • Incoming updates are merged into the aggregate structure using optimistic locking to avoid lock contention Reading Updates • Add a new collector that reads from the Update Database • Use Digesters to perform arbitrary transformations on the stream of updates (e.g, collapse 10 updates from a user into 1)
  • 31. 2008 JavaOneSM Conference | java.sun.com/javaone | 31 Network Updates Service Iteration 2 Lessons learned: • Underestimated the volume of updates to be processed • CLOB block size was set to 8k, leading to a lot of wasted space (which isn’t reclaimed!) • Real-time monitoring/configuration with Java Management Extension (JMX™) specification was extremely helpful
  • 32. 2008 JavaOneSM Conference | java.sun.com/javaone | 32 Network Updates Service Iteration 3 Updating a CLOB is expensive Goal: Minimize the number of CLOB updates • Use an overflow buffer • Reduce the size of the updates
  • 33. 2008 JavaOneSM Conference | java.sun.com/javaone | 33 Network Updates Service Iteration 3 - Overflow Buffer Add VARCHAR(4000) column that acts as a buffer When the buffer is full, dump it to the CLOB and reset Avoids over 90% of CLOB updates (depending on type), while still retaining the flexibility for more storage
  • 34. 2008 JavaOneSM Conference | java.sun.com/javaone | 34 Scaling the system What you learn as you scale: • A single database does not work • Referential integrity will not be possible • Cost becomes a factor: databases, hardware, licenses, storage, power • Any data loss is a problem • Data warehousing and analytics becomes a problem • Your system becomes a target for spamming exploits, data scraping, etc. What to do: • Partition everything: • by user groups • by domain • by function • Caching is good even when it’s only modestly effective • Give up on 100% data integrity • Build for asynchronous flows • Build with reporting in mind • Expect your system to fail at any point • Never underestimate growth trajectory
  • 35. 2008 JavaOneSM Conference | java.sun.com/javaone | 35 LinkedIn Communication Architecture Build with scalability in mind - never know when your business will take off Expect to do a lot of architecture and code refactoring as you learn and appreciate growth challenges
  • 36. LinkedIn Communication Architecture Ruslan Belkin (http://www.linkedin.com/in/rbelkin) Sean Dawson (http://www.linkedin.com/in/seandawson) We are hiring!
  • 37. 2008 JavaOneSM Conference | java.sun.com/javaone | 37 The Communication Service LinkedIn Spring Extensions Automatic context instantiation from multiple spring files LinkedIn Spring Components Property expansion Automatic termination handling Support for Builder Pattern Custom property editors: • Timespan (30s, 4h34m, etc.) • Memory Size, etc.
  • 38. 2008 JavaOneSM Conference | java.sun.com/javaone | 38 Comm-server/ cmpt/ components/ ccsServiceExporter.spring comm.spring jmx.spring comm-server.properties corpMboxServiceExporter.spring main.spring comm-server.spring memberMboxServiceExporter.spring comm.properties guestMboxServiceExporter.spring build.xml impl/ … The Communication Service LinkedIn Spring Extensions
  • 39. 2008 JavaOneSM Conference | java.sun.com/javaone | 39 … <bean id="resolver” class="com.linkedin.comm.pub.impl.MessageAddressResolver"> <lin:config> <property name="resolverDB" ref="resolverDB"/> <property name="eos" ref="eos"/> <property name="els" ref="eos"/> <property name="memberAccessor" ref="coreMemberAccessor"/> </lin:config> </bean> … The Communication Service LinkedIn Spring Extensions
  • 40. 2008 JavaOneSM Conference | java.sun.com/javaone | 40 private final MessageAddressResolverDB _resolverDB; … MessageAddressResolver(Config config) { … } … public static class Config { private MessageAddressResolverDB _resolverDB; public MessageAddressResolverDB getResolverDB() { return ConfigHelper.getRequired(_resolverDB); } public void setResolverDB(MessageAddressResolverDB resolverDB) { _resolverDB = resolverDB; } }/*Config*/ The Communication Service LinkedIn Spring Extensions (Builder)
  • 41. 2008 JavaOneSM Conference | java.sun.com/javaone | 41 … <lin:component id="remoteContentCommunicationService" location="comm-server-client-cmpt"> <lin:wire property-name="activemq.producer.brokerURL" property- value="${activemq.producer.brokerURL}"/> <lin:wire property-name="comm.server.httpRpc.url" property- value="${leo.comm.server.httpRpc.url}"/> </lin:component> … The Communication Service LinkedIn Spring Extensions (Components)