SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Building Consistent
RESTful APIs in a High-
Performance Environment
Yegor Borovikov, Software Architect
Brandon Duncan, Director of Engineering
LinkedIn Corporation
http://blog.linkedin.com/
Topics We’ll Cover

>   Examples of RESTful APIs
       What’s missing?
       Variety versus Uniformity
>   Domain Model as Foundation
       Provides Uniformity
       Allows Flexibility
>   Examples of LinkedIn APIs
>   Using Incentives to Scale
       Some LinkedIn production APIs metrics
>   Q&A
                                                2
Examples of RESTful APIs
What if you want to get a person’s profile?
>   Use one of these…
    http://social.yahooapis.com/v1/user/{guid}/profile
    http://api.linkedin.com/v1/people/{guid}
    http://www.orkut.com/social/rest/people/{guid}/@self
    <?xml version="1.0" encoding="UTF-8"?>
    <person>
     <id>111222</id>
     <first-name>Gertrude</first-name>
     <last-name>Stein</last-name>
     <headline>Author of Tender Buttons</headline>
     <connections total="76">
     …
    </person>



                                                           3
Examples of RESTful APIs
What’s Missing?
>   Ability to get exactly what you need (variety)
       If you need more, may require multiple
        API calls (if they exist)
       If you need less, resources are wasted

>   Consistency of responses (uniformity)
       “Same” object returned by different APIs
        may have different structure
       Once in production, hard to get consistent later



                                                           4
Examples of RESTful APIs
Multiple Calls to Get What You Need
>   Want to get user’s friend’s profile? Do this…
       http://social.yahooapis.com/v1/user/123/connections
<connections yahoo:start="0" yahoo:count="1" yahoo:total="1">
 <connection yahoo:uri="http://social.yahooapis.com/v1/user/123/connection/456?
view=usercard">
   <guid>456</guid>
   <contactId>4</contactId>
 </connection>
</connections>




                                                                                  5
Examples of RESTful APIs
Multiple Calls to Get What You Need
>   … then make second call to get friend’s profile:
    http://social.yahooapis.com/v1/user/456/profile
    <profile yahoo:uri="http://social.yahooapis.com/v1/user/456/profile">
     <guid>456</guid>
     <birthdate>3/3</birthdate>
     <created>2008-08-4T17:13:56Z</created>
     ...
    </profile>

       Latent, redundant data
       Optimization requires stickiness


                                                                            6
Typical Solution
Variety versus Uniformity
>   Solution: introduce another call

>   Desire for variety of responses
    undermines uniformity of requests

>   Leads to RPC-like REST APIs

>   Many APIs + Great Documentation =
    Lots of Reading + Lack of Automation


                                           7
Domain Model as Foundation
Sample Domain Model
/people : Person[]     //   collection of Person resources
   /id : string        //   primary key
   /name : string
   /email : string     //   unique key
   /photo : url
   /best-friend : Person
   /friends : Person[]
   /jobs : Job[]       //   collection of Job resources
      /company : Company
      /title : string
      /start-date : date
      /end-date : date
   …
/companies : Company[]
   /name : string
   /ceo : Person
   …

                                                             8
Domain Model as Foundation
Follow request URL to navigate through your model
>   To get a person’s profile:
    http://api.linkedin.com/v2/people/123
                                                          /people[/id=123]
    <person uri=“urn:linkedin:v2:people/123” key=“123”>      /id
      <id>123</id>                                           /name
      <name>Reid Hoffman</name>                              /email
                                                             /photo
      <email>reid@linkedin.com</email>                       /best-friend
      <best-friend uri=“urn:linkedin:v2:people/456”/>        /friends
      …                                                      /jobs
                                                                /company
    </person>                                                   /title
                                                                /start-date
                                                                /end-date
                                                             …
       Conventional URL in request                       /companies
                                                             /name
       Default representation in response                   /ceo
                                                             …



                                                                              9
Domain Model as Foundation
Fine-grained Request
>   What if you only need certain fields
    (e.g., name and photo)?
    http://api.linkedin.com/v2/people/123:(name,photo)
    <person>
     <name>Reid Hoffman</name>
                                                                /people[/id=123]
     <photo>http://media.linkedin.com/photos/123.jpeg</photo>      /id
    </person>                                                      /name
                                                                   /email
                                                                   /photo
                                                                   /best-friend
                                                                   /friends
                                                                   /jobs
                                                                      /company
                                                                      /title
                                                                      /start-date
                                                                      /end-date
                                                                   …


                                                                                    10
Domain Model as Foundation
Fine-grained Request
>   To get names and photos of one’s friends and
    their best friends:
    …/v2/people/456/friends:(name,photo,best-friend:
     (name,photo))                        /people[/id=456]
                                                                    /id
    <friends total=“66” start=“0”>                                  /name
     <friend uri=“urn:linkedin:v2:people/123” key=“123”>            /email
                                                                    /photo
       <name>Reid Hoffman</name>                                    /best-friend
       <photo>http://media.linkedin.com/photos/123.jpeg</photo>     /friends
       <best-friend uri=“urn:linkedin:v2:people/456” key=“456”>        /123
                                                                         /id
         <name>Brandon Duncan</name>                                     /name
         <photo>http://media.linkedin.com/photos/456.jpeg</photo>        /email
                                                                         /photo
       </best-friend>                                                    /best-friend
     </friend>                                                              /name
     <friend>…</friend>                                                     /photo
                                                                    /jobs
    </friends>                                                      …


                                                                                        11
Domain Model as Foundation
Fine-grained Request
>   Allows client to construct custom calls

>   Better than digging for the closest matching API:
    http://social...com/v1/user/123/profile
    http://social...com/v1/user/123/profile/usercard
    http://social...com/v1/user/123/profile/tinyusercard

>   Allows optimization on the backend



                                                           12
Domain Model as Foundation
Benefits
>   Provides a frame for both request and response
    semantics
>   Still allows for flexible syntax
       Requests – path, query params, matrix params…
       Responses – JSON, XML, POJOs, protobuff…
>   Helps to unify and automate many development
    tasks on both ends
       Request / response creation, parsing, marshalling
       Code (and documentation) generation
       Discovery services

                                                            13
Examples of LinkedIn APIs
HTTP GET - Read

   …/people/email=brandon@gmail.com/friends?sort=name

   …/people/123/friends;sort=name:(name,jobs;sort=start-date)

   …/people:(id,name,photo)?name=page&company=google

   …/people::(123,456)
   …/people::(123,456):(name,photo)




                                                                14
Examples of LinkedIn APIs
HTTP PUT - Update
>   Set the user’s name:                           /people[/id=123]
                                                      /id
                                                      /name
PUT http://api.linkedin.com/v2/people/123/name        /email
<name>Reid Hoffmann</name>                            /photo
                                                      /best-friend
                                                      …

>   Update the user’s profile - change name and best-
    friend and remove photo:
PUT http://api.linkedin.com/v2/people/123
<person>                                           /people[/id=123]
 <name>Reid Hoffman</name>                            /id
                                                      /name
 <best-friend uri=“urn:linkedin:v2:people/999”/>      /email
 <photo xsi:nil=“true”/>                              /photo
</person>                                             /best-friend
                                                      …




                                                                      15
Examples of LinkedIn APIs
HTTP POST - Create
>   Add a friend                                              /people[/id=123]
                                                                 /id
POST http://api.linkedin.com/v2/people/123/friends               /name
                                                                 /email
<friend uri=“urn:linkedin:v2:people/888”/>                       /photo
                                                                 /best-friend
201 Created                                                      /friends
                                                                   /456
Location: http://api.linkedin.com/v2/people/123/friends/888        /888
                                                                 …




                                                                                 16
Examples of LinkedIn APIs
HTTP DELETE - Remove
>   Remove a friend
DELETE http://api.linkedin.com/v2/people/123/friends/456

>   Delete a company
DELETE
  http://api.linkedin.com/v2/companies/exchange=NYSE&ticker=GM

>   Delete two companies
DELETE http://api.linkedin.com/v2/companies::(664,665)




                                                                 17
Use Standard Headers

>   Content-Type
>   Last-Modified
>   Accept
>   Vary
>   Authorization
>   Cache-Control
>   Content-MD5
>   Location
>   Warning

                       18
Incentive System

>   Multiple ways to get at the same data

>   Partner can ask for exactly what they need

>   Associate cost with resources, system of
    accounting creates incentives for partners

>   Throttling by resource rather than API



                                                 19
Real-World Example
Xobni Toolbar
>   Xobni makes ~20 million profile API calls per week
>   Default representation is ~2k on average
>   Using in-line filter brings average to ~1.5k
        25% reduction in response size
        ~11000 Mbits savings per day
             11k Mbits out of LinkedIn datacenter
             11k Mbits into Xobni datacenter
             Saves both companies money




                                                         20
Yegor Borovikov
yborovik@linkedin.com
Brandon Duncan
bduncan@linkedin.com
blog.linkedin.com


                        21

Weitere ähnliche Inhalte

Was ist angesagt?

Shipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, AdjustShipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, AdjustAltinity Ltd
 
18 ellipses x
18 ellipses x18 ellipses x
18 ellipses xmath260
 
21 properties of division and roots x
21 properties of division and roots x21 properties of division and roots x
21 properties of division and roots xmath260
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB
 
New Framework - ORM
New Framework - ORMNew Framework - ORM
New Framework - ORMOdoo
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of PrestoTaro L. Saito
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't FreeKelley Robinson
 
مراجعة مركزة -قصي هاشم 2015
مراجعة مركزة -قصي هاشم 2015مراجعة مركزة -قصي هاشم 2015
مراجعة مركزة -قصي هاشم 2015Online
 
FUZZY GRAPHS IN FUZZY AUTOMATA MODEL
FUZZY GRAPHS IN FUZZY AUTOMATA MODELFUZZY GRAPHS IN FUZZY AUTOMATA MODEL
FUZZY GRAPHS IN FUZZY AUTOMATA MODELIJESM JOURNAL
 
9 the basic language of functions x
9 the basic language of functions x9 the basic language of functions x
9 the basic language of functions xmath260
 
RedisConf17 - Distributed Java Map Structures and Services with Redisson
RedisConf17 - Distributed Java Map Structures and Services with RedissonRedisConf17 - Distributed Java Map Structures and Services with Redisson
RedisConf17 - Distributed Java Map Structures and Services with RedissonRedis Labs
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
 
The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)Scott Wlaschin
 

Was ist angesagt? (14)

Shipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, AdjustShipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
Shipping Data from Postgres to Clickhouse, by Murat Kabilov, Adjust
 
18 ellipses x
18 ellipses x18 ellipses x
18 ellipses x
 
Comonads in Haskell
Comonads in HaskellComonads in Haskell
Comonads in Haskell
 
21 properties of division and roots x
21 properties of division and roots x21 properties of division and roots x
21 properties of division and roots x
 
MongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDBMongoDB Europe 2016 - Graph Operations with MongoDB
MongoDB Europe 2016 - Graph Operations with MongoDB
 
New Framework - ORM
New Framework - ORMNew Framework - ORM
New Framework - ORM
 
Reading The Source Code of Presto
Reading The Source Code of PrestoReading The Source Code of Presto
Reading The Source Code of Presto
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
 
مراجعة مركزة -قصي هاشم 2015
مراجعة مركزة -قصي هاشم 2015مراجعة مركزة -قصي هاشم 2015
مراجعة مركزة -قصي هاشم 2015
 
FUZZY GRAPHS IN FUZZY AUTOMATA MODEL
FUZZY GRAPHS IN FUZZY AUTOMATA MODELFUZZY GRAPHS IN FUZZY AUTOMATA MODEL
FUZZY GRAPHS IN FUZZY AUTOMATA MODEL
 
9 the basic language of functions x
9 the basic language of functions x9 the basic language of functions x
9 the basic language of functions x
 
RedisConf17 - Distributed Java Map Structures and Services with Redisson
RedisConf17 - Distributed Java Map Structures and Services with RedissonRedisConf17 - Distributed Java Map Structures and Services with Redisson
RedisConf17 - Distributed Java Map Structures and Services with Redisson
 
Http4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web StackHttp4s, Doobie and Circe: The Functional Web Stack
Http4s, Doobie and Circe: The Functional Web Stack
 
The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)The Power of Composition (NDC Oslo 2020)
The Power of Composition (NDC Oslo 2020)
 

Ähnlich wie Building Consistent RESTful APIs in a high-performance environment

Building Viral Social Experiences
Building Viral Social ExperiencesBuilding Viral Social Experiences
Building Viral Social ExperiencesJonathan LeBlanc
 
Rest experience-report
Rest experience-reportRest experience-report
Rest experience-reportJim Barritt
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practicehamnis
 
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010Lincoln III
 
MTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi DevicesMTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi DevicesHasan Hosgel
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatraa_l
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extendSeek Tan
 
Proposed schema changes - have your say
Proposed schema changes - have your sayProposed schema changes - have your say
Proposed schema changes - have your sayCrossref
 
WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)Stephanie Leary
 
Gem christmas calendar
Gem christmas calendarGem christmas calendar
Gem christmas calendarerichsen
 
[2019] HTTP API 설계 후회 고민
[2019] HTTP API 설계 후회 고민[2019] HTTP API 설계 후회 고민
[2019] HTTP API 설계 후회 고민NHN FORWARD
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Fabio Kung
 
Building Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureBuilding Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureSupote Phunsakul
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference ClientDallan Quass
 
Creating HTML Pages
Creating HTML PagesCreating HTML Pages
Creating HTML PagesMike Crabb
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaRavi Mynampaty
 

Ähnlich wie Building Consistent RESTful APIs in a high-performance environment (20)

Building Viral Social Experiences
Building Viral Social ExperiencesBuilding Viral Social Experiences
Building Viral Social Experiences
 
Rest experience-report
Rest experience-reportRest experience-report
Rest experience-report
 
REST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practiceREST teori og praksis; REST in theory and practice
REST teori og praksis; REST in theory and practice
 
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010
PrettyFaces URLRewrite for Servlet & JavaEE @ Devoxx 2010
 
MTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi DevicesMTC 2013 Berlin - Best Practices for Multi Devices
MTC 2013 Berlin - Best Practices for Multi Devices
 
Rest schema design
Rest schema designRest schema design
Rest schema design
 
Simple Web Apps With Sinatra
Simple Web Apps With SinatraSimple Web Apps With Sinatra
Simple Web Apps With Sinatra
 
Microdata semantic-extend
Microdata semantic-extendMicrodata semantic-extend
Microdata semantic-extend
 
Jarrar: RDFa
Jarrar: RDFaJarrar: RDFa
Jarrar: RDFa
 
Jarrar: RDFa
Jarrar: RDFaJarrar: RDFa
Jarrar: RDFa
 
Proposed schema changes - have your say
Proposed schema changes - have your sayProposed schema changes - have your say
Proposed schema changes - have your say
 
WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)WordPress Tips and Tricks (DFW Meetup)
WordPress Tips and Tricks (DFW Meetup)
 
Gem christmas calendar
Gem christmas calendarGem christmas calendar
Gem christmas calendar
 
[2019] HTTP API 설계 후회 고민
[2019] HTTP API 설계 후회 고민[2019] HTTP API 설계 후회 고민
[2019] HTTP API 설계 후회 고민
 
Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?Onde mora a produtividade do Ruby on Rails?
Onde mora a produtividade do Ruby on Rails?
 
Eu odeio OpenSocial
Eu odeio OpenSocialEu odeio OpenSocial
Eu odeio OpenSocial
 
Building Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows AzureBuilding Windows 8 Apps with Windows Azure
Building Windows 8 Apps with Windows Azure
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference Client
 
Creating HTML Pages
Creating HTML PagesCreating HTML Pages
Creating HTML Pages
 
Build Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to OmegaBuild Your Own World Class Directory Search From Alpha to Omega
Build Your Own World Class Directory Search From Alpha to Omega
 

Mehr von LinkedIn

How LinkedIn is Transforming Businesses
How LinkedIn is Transforming BusinessesHow LinkedIn is Transforming Businesses
How LinkedIn is Transforming BusinessesLinkedIn
 
Networking on LinkedIn 101
Networking on LinkedIn 101Networking on LinkedIn 101
Networking on LinkedIn 101LinkedIn
 
5 تحديثات على ملفك في 5 دقائق
5 تحديثات على ملفك في 5 دقائق5 تحديثات على ملفك في 5 دقائق
5 تحديثات على ملفك في 5 دقائقLinkedIn
 
5 LinkedIn Profile Updates in 5 Minutes
5 LinkedIn Profile Updates in 5 Minutes5 LinkedIn Profile Updates in 5 Minutes
5 LinkedIn Profile Updates in 5 MinutesLinkedIn
 
The Student's Guide to LinkedIn
The Student's Guide to LinkedInThe Student's Guide to LinkedIn
The Student's Guide to LinkedInLinkedIn
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017LinkedIn
 
Accelerating LinkedIn’s Vision Through Innovation
Accelerating LinkedIn’s Vision Through InnovationAccelerating LinkedIn’s Vision Through Innovation
Accelerating LinkedIn’s Vision Through InnovationLinkedIn
 
How To Tell Your #workstory
How To Tell Your #workstoryHow To Tell Your #workstory
How To Tell Your #workstoryLinkedIn
 
LinkedIn Q1 2016 Earnings Call
LinkedIn Q1 2016 Earnings CallLinkedIn Q1 2016 Earnings Call
LinkedIn Q1 2016 Earnings CallLinkedIn
 
The 2016 LinkedIn Job Search Guide
The 2016 LinkedIn Job Search GuideThe 2016 LinkedIn Job Search Guide
The 2016 LinkedIn Job Search GuideLinkedIn
 
LinkedIn Q4 2015 Earnings Call
LinkedIn Q4 2015 Earnings CallLinkedIn Q4 2015 Earnings Call
LinkedIn Q4 2015 Earnings CallLinkedIn
 
Banish The Buzzwords
Banish The BuzzwordsBanish The Buzzwords
Banish The BuzzwordsLinkedIn
 
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career Advice
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career AdviceLinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career Advice
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career AdviceLinkedIn
 
LinkedIn Q3 2015 Earnings Call
LinkedIn Q3 2015 Earnings CallLinkedIn Q3 2015 Earnings Call
LinkedIn Q3 2015 Earnings CallLinkedIn
 
LinkedIn Economic Graph Research: Toronto
LinkedIn Economic Graph Research: TorontoLinkedIn Economic Graph Research: Toronto
LinkedIn Economic Graph Research: TorontoLinkedIn
 
Freelancers Are LinkedIn Power Users [Infographic]
Freelancers Are LinkedIn Power Users [Infographic]Freelancers Are LinkedIn Power Users [Infographic]
Freelancers Are LinkedIn Power Users [Infographic]LinkedIn
 
Top Industries for Freelancers on LinkedIn [Infographic]
Top Industries for Freelancers on LinkedIn [Infographic]Top Industries for Freelancers on LinkedIn [Infographic]
Top Industries for Freelancers on LinkedIn [Infographic]LinkedIn
 
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...LinkedIn
 
LinkedIn Connect to Opportunity™ -- Stories of Discovery
LinkedIn Connect to Opportunity™ -- Stories of DiscoveryLinkedIn Connect to Opportunity™ -- Stories of Discovery
LinkedIn Connect to Opportunity™ -- Stories of DiscoveryLinkedIn
 
LinkedIn Q2 2015 Earnings Call
LinkedIn Q2 2015 Earnings CallLinkedIn Q2 2015 Earnings Call
LinkedIn Q2 2015 Earnings CallLinkedIn
 

Mehr von LinkedIn (20)

How LinkedIn is Transforming Businesses
How LinkedIn is Transforming BusinessesHow LinkedIn is Transforming Businesses
How LinkedIn is Transforming Businesses
 
Networking on LinkedIn 101
Networking on LinkedIn 101Networking on LinkedIn 101
Networking on LinkedIn 101
 
5 تحديثات على ملفك في 5 دقائق
5 تحديثات على ملفك في 5 دقائق5 تحديثات على ملفك في 5 دقائق
5 تحديثات على ملفك في 5 دقائق
 
5 LinkedIn Profile Updates in 5 Minutes
5 LinkedIn Profile Updates in 5 Minutes5 LinkedIn Profile Updates in 5 Minutes
5 LinkedIn Profile Updates in 5 Minutes
 
The Student's Guide to LinkedIn
The Student's Guide to LinkedInThe Student's Guide to LinkedIn
The Student's Guide to LinkedIn
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
 
Accelerating LinkedIn’s Vision Through Innovation
Accelerating LinkedIn’s Vision Through InnovationAccelerating LinkedIn’s Vision Through Innovation
Accelerating LinkedIn’s Vision Through Innovation
 
How To Tell Your #workstory
How To Tell Your #workstoryHow To Tell Your #workstory
How To Tell Your #workstory
 
LinkedIn Q1 2016 Earnings Call
LinkedIn Q1 2016 Earnings CallLinkedIn Q1 2016 Earnings Call
LinkedIn Q1 2016 Earnings Call
 
The 2016 LinkedIn Job Search Guide
The 2016 LinkedIn Job Search GuideThe 2016 LinkedIn Job Search Guide
The 2016 LinkedIn Job Search Guide
 
LinkedIn Q4 2015 Earnings Call
LinkedIn Q4 2015 Earnings CallLinkedIn Q4 2015 Earnings Call
LinkedIn Q4 2015 Earnings Call
 
Banish The Buzzwords
Banish The BuzzwordsBanish The Buzzwords
Banish The Buzzwords
 
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career Advice
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career AdviceLinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career Advice
LinkedIn Bring In Your Parents Day 2015 - Your Parents' Best Career Advice
 
LinkedIn Q3 2015 Earnings Call
LinkedIn Q3 2015 Earnings CallLinkedIn Q3 2015 Earnings Call
LinkedIn Q3 2015 Earnings Call
 
LinkedIn Economic Graph Research: Toronto
LinkedIn Economic Graph Research: TorontoLinkedIn Economic Graph Research: Toronto
LinkedIn Economic Graph Research: Toronto
 
Freelancers Are LinkedIn Power Users [Infographic]
Freelancers Are LinkedIn Power Users [Infographic]Freelancers Are LinkedIn Power Users [Infographic]
Freelancers Are LinkedIn Power Users [Infographic]
 
Top Industries for Freelancers on LinkedIn [Infographic]
Top Industries for Freelancers on LinkedIn [Infographic]Top Industries for Freelancers on LinkedIn [Infographic]
Top Industries for Freelancers on LinkedIn [Infographic]
 
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...
LinkedIn Quiz: Which Parent Are You When It Comes to Helping Guide Your Child...
 
LinkedIn Connect to Opportunity™ -- Stories of Discovery
LinkedIn Connect to Opportunity™ -- Stories of DiscoveryLinkedIn Connect to Opportunity™ -- Stories of Discovery
LinkedIn Connect to Opportunity™ -- Stories of Discovery
 
LinkedIn Q2 2015 Earnings Call
LinkedIn Q2 2015 Earnings CallLinkedIn Q2 2015 Earnings Call
LinkedIn Q2 2015 Earnings Call
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
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
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
[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
 

Kürzlich hochgeladen (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
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
 
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?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
[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
 

Building Consistent RESTful APIs in a high-performance environment

  • 1. Building Consistent RESTful APIs in a High- Performance Environment Yegor Borovikov, Software Architect Brandon Duncan, Director of Engineering LinkedIn Corporation http://blog.linkedin.com/
  • 2. Topics We’ll Cover > Examples of RESTful APIs  What’s missing?  Variety versus Uniformity > Domain Model as Foundation  Provides Uniformity  Allows Flexibility > Examples of LinkedIn APIs > Using Incentives to Scale  Some LinkedIn production APIs metrics > Q&A 2
  • 3. Examples of RESTful APIs What if you want to get a person’s profile? > Use one of these… http://social.yahooapis.com/v1/user/{guid}/profile http://api.linkedin.com/v1/people/{guid} http://www.orkut.com/social/rest/people/{guid}/@self <?xml version="1.0" encoding="UTF-8"?> <person> <id>111222</id> <first-name>Gertrude</first-name> <last-name>Stein</last-name> <headline>Author of Tender Buttons</headline> <connections total="76"> … </person> 3
  • 4. Examples of RESTful APIs What’s Missing? > Ability to get exactly what you need (variety)  If you need more, may require multiple API calls (if they exist)  If you need less, resources are wasted > Consistency of responses (uniformity)  “Same” object returned by different APIs may have different structure  Once in production, hard to get consistent later 4
  • 5. Examples of RESTful APIs Multiple Calls to Get What You Need > Want to get user’s friend’s profile? Do this…  http://social.yahooapis.com/v1/user/123/connections <connections yahoo:start="0" yahoo:count="1" yahoo:total="1"> <connection yahoo:uri="http://social.yahooapis.com/v1/user/123/connection/456? view=usercard"> <guid>456</guid> <contactId>4</contactId> </connection> </connections> 5
  • 6. Examples of RESTful APIs Multiple Calls to Get What You Need > … then make second call to get friend’s profile: http://social.yahooapis.com/v1/user/456/profile <profile yahoo:uri="http://social.yahooapis.com/v1/user/456/profile"> <guid>456</guid> <birthdate>3/3</birthdate> <created>2008-08-4T17:13:56Z</created> ... </profile>  Latent, redundant data  Optimization requires stickiness 6
  • 7. Typical Solution Variety versus Uniformity > Solution: introduce another call > Desire for variety of responses undermines uniformity of requests > Leads to RPC-like REST APIs > Many APIs + Great Documentation = Lots of Reading + Lack of Automation 7
  • 8. Domain Model as Foundation Sample Domain Model /people : Person[] // collection of Person resources /id : string // primary key /name : string /email : string // unique key /photo : url /best-friend : Person /friends : Person[] /jobs : Job[] // collection of Job resources /company : Company /title : string /start-date : date /end-date : date … /companies : Company[] /name : string /ceo : Person … 8
  • 9. Domain Model as Foundation Follow request URL to navigate through your model > To get a person’s profile: http://api.linkedin.com/v2/people/123 /people[/id=123] <person uri=“urn:linkedin:v2:people/123” key=“123”> /id <id>123</id> /name <name>Reid Hoffman</name> /email /photo <email>reid@linkedin.com</email> /best-friend <best-friend uri=“urn:linkedin:v2:people/456”/> /friends … /jobs /company </person> /title /start-date /end-date …  Conventional URL in request /companies /name  Default representation in response /ceo … 9
  • 10. Domain Model as Foundation Fine-grained Request > What if you only need certain fields (e.g., name and photo)? http://api.linkedin.com/v2/people/123:(name,photo) <person> <name>Reid Hoffman</name> /people[/id=123] <photo>http://media.linkedin.com/photos/123.jpeg</photo> /id </person> /name /email /photo /best-friend /friends /jobs /company /title /start-date /end-date … 10
  • 11. Domain Model as Foundation Fine-grained Request > To get names and photos of one’s friends and their best friends: …/v2/people/456/friends:(name,photo,best-friend: (name,photo)) /people[/id=456] /id <friends total=“66” start=“0”> /name <friend uri=“urn:linkedin:v2:people/123” key=“123”> /email /photo <name>Reid Hoffman</name> /best-friend <photo>http://media.linkedin.com/photos/123.jpeg</photo> /friends <best-friend uri=“urn:linkedin:v2:people/456” key=“456”> /123 /id <name>Brandon Duncan</name> /name <photo>http://media.linkedin.com/photos/456.jpeg</photo> /email /photo </best-friend> /best-friend </friend> /name <friend>…</friend> /photo /jobs </friends> … 11
  • 12. Domain Model as Foundation Fine-grained Request > Allows client to construct custom calls > Better than digging for the closest matching API: http://social...com/v1/user/123/profile http://social...com/v1/user/123/profile/usercard http://social...com/v1/user/123/profile/tinyusercard > Allows optimization on the backend 12
  • 13. Domain Model as Foundation Benefits > Provides a frame for both request and response semantics > Still allows for flexible syntax  Requests – path, query params, matrix params…  Responses – JSON, XML, POJOs, protobuff… > Helps to unify and automate many development tasks on both ends  Request / response creation, parsing, marshalling  Code (and documentation) generation  Discovery services 13
  • 14. Examples of LinkedIn APIs HTTP GET - Read …/people/email=brandon@gmail.com/friends?sort=name …/people/123/friends;sort=name:(name,jobs;sort=start-date) …/people:(id,name,photo)?name=page&company=google …/people::(123,456) …/people::(123,456):(name,photo) 14
  • 15. Examples of LinkedIn APIs HTTP PUT - Update > Set the user’s name: /people[/id=123] /id /name PUT http://api.linkedin.com/v2/people/123/name /email <name>Reid Hoffmann</name> /photo /best-friend … > Update the user’s profile - change name and best- friend and remove photo: PUT http://api.linkedin.com/v2/people/123 <person> /people[/id=123] <name>Reid Hoffman</name> /id /name <best-friend uri=“urn:linkedin:v2:people/999”/> /email <photo xsi:nil=“true”/> /photo </person> /best-friend … 15
  • 16. Examples of LinkedIn APIs HTTP POST - Create > Add a friend /people[/id=123] /id POST http://api.linkedin.com/v2/people/123/friends /name /email <friend uri=“urn:linkedin:v2:people/888”/> /photo /best-friend 201 Created /friends /456 Location: http://api.linkedin.com/v2/people/123/friends/888 /888 … 16
  • 17. Examples of LinkedIn APIs HTTP DELETE - Remove > Remove a friend DELETE http://api.linkedin.com/v2/people/123/friends/456 > Delete a company DELETE http://api.linkedin.com/v2/companies/exchange=NYSE&ticker=GM > Delete two companies DELETE http://api.linkedin.com/v2/companies::(664,665) 17
  • 18. Use Standard Headers > Content-Type > Last-Modified > Accept > Vary > Authorization > Cache-Control > Content-MD5 > Location > Warning 18
  • 19. Incentive System > Multiple ways to get at the same data > Partner can ask for exactly what they need > Associate cost with resources, system of accounting creates incentives for partners > Throttling by resource rather than API 19
  • 20. Real-World Example Xobni Toolbar > Xobni makes ~20 million profile API calls per week > Default representation is ~2k on average > Using in-line filter brings average to ~1.5k  25% reduction in response size  ~11000 Mbits savings per day  11k Mbits out of LinkedIn datacenter  11k Mbits into Xobni datacenter  Saves both companies money 20