Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Hypermedia APIs that make sense

1 975 vues

Publié le

Talk at APIdays Paris 2015

Publié dans : Internet
  • Soyez le premier à commenter

Hypermedia APIs that make sense

  1. 1. SIMPLE
 SERVERS CLEVER
 CLIENTS Ruben Verborgh Hypermedia APIs that make sense
  2. 2. HOW DO WE MEASURE SUCCESS?
  3. 3. MY API IS GOOD
 BECAUSE I USE SWAGGER. YOUR API SUCKS
 BECAUSE IT’S NOT REST. MY API IS DOING HYPERMEDIA,
 LIKE, FOR REAL.
  4. 4. MY WEBSITE IS GOOD
 BECAUSE I USE FLASH. YOUR WEBSITE SUCKS
 BECAUSE THE MENU IS ON TOP. MY WEBSITE REQUIRES ONLY
 3 CLICKS TO ACCESS STUFF.
  5. 5. API DESIGN
 IS STUCK WHERE WEB INTERACTION DESIGN WAS 15 YEARS AGO.
  6. 6. WEB INTERACTION DESIGN IN 2015 IS MEASURABLE:
 HOW LONG DOES IT TAKE
 CUSTOMERS TO BUY
 WHAT THEY WANT?
  7. 7. WEB INTERACTION DESIGN IN 2015 IS MEASURABLE:
 HOW OFTEN IS
 OUR CONTENT SHARED
 ON TWITTER?
  8. 8. HOW CAN WE
 MEASURE WEB API DESIGN DECISIONS?
  9. 9. HOW CAN WE
 MEASURE WEB API DESIGN DECISIONS? www.docsduds.com
  10. 10. PUBLISHING
 LINKED DATA QUANTIFYING WEB APIS MAKING SENSE
 WITH HYPERMEDIA 1 2 3
  11. 11. PUBLISHING
 LINKED DATA QUANTIFYING WEB APIS MAKING SENSE
 WITH HYPERMEDIA 1 2 3
  12. 12. LINKED DATA
 CAPTURES FACTS
 WITH LINKS
  13. 13. http://dbpedia.org/
 resource/Nikola_Tesla http://dbpedia.org/
 resource/Thomas_Edison http://xmlns.com/foaf/
 0.1/knows “Nikola” http://xmlns.com/foaf/
 0.1/givenName RDF
  14. 14. { "@id": "dbpedia:Nikola_Tesla", "foaf:knows": "dbpedia:Thomas_Edison", "foaf:givenName": "Nikola"
 JSON-LD ! ! ! ! }
  15. 15. WIKIPEDIA IS
 TRANSLATED INTO
 500 MILLION
 LINKED DATA FACTS.
  16. 16. IT CAN BE QUERIED
 BY THE WEB’S
 MOST POWERFUL API.
  17. 17. SPARQLQUERY LANGUAGE
  18. 18. ? ? ? SPARQL
  19. 19. WHICH FRENCH CITIES
 HAVE A POPULATION OF
 MORE THAN 200.000? SPARQL
  20. 20. WHICH MOVIES WERE DIRECTED BY WOMEN WHO WROTE NOVELS? SPARQL
  21. 21. SPARQL
 WEB API
  22. 22. THE WEB API
 IS THE SAME
 AS THE LANGUAGE:
 ASK ANYTHING
  23. 23. /SPARQL?QUERY=
 WHICH FRENCH CITIES
 HAVE A POPULATION OF
 MORE THAN 200.000? SPARQL
  24. 24. /SPARQL?QUERY=
 WHICH MOVIES WERE DIRECTED BY WOMEN WHO WROTE NOVELS? SPARQL
  25. 25. IT’S LIKE THE
 GRAPHQL OF
 LINKED DATA WITHOUT MONEY
  26. 26. THE SPARQL API
 IS SO POWERFUL THAT
 THAT MOST ENDPOINTS ARE DOWN
 > 1.5 DAY EACH MONTH
  27. 27. THE SPARQL API
 IS SO POWERFUL THAT
 THAT MOST ENDPOINTS
 ARE DOWN
 > 1.5 DAY EACH MONTH
  28. 28. PUBLISHING
 LINKED DATA QUANTIFYING WEB APIS MAKING SENSE
 WITH HYPERMEDIA 1 2 3
  29. 29. SPARQL
 WEB API LET’S MEASURE THE
  30. 30. 
S! C
  31. 31. 
S! C ! C ! C ! C ! C ! C ! C
  32. 32. EACH CLIENT SENDS
 UNIQUE REQUESTS, SO
 CACHING IS INEFFECTIVE REQUESTS CAN BE
 ARBITRARILY COMPLICATED THE INTERFACE
 IS EXPENSIVE
  33. 33. 1 240 CLIENTS SPARQL API QUERIES
 PER HOUR 100 200
  34. 34. SPARQL API 1 240 CLIENTS100 200 SERVER
 CPU LOAD
  35. 35. SPARQL API 1 240 CLIENTS100 200 CLIENT
 CPU LOAD
  36. 36. SPARQL API 1 240 CLIENTS100 200 CACHE
 REUSE
  37. 37. WHO WILL PAY
 FOR SUCH AN
 EXPENSIVE API?
  38. 38. PUBLISHING
 LINKED DATA QUANTIFYING WEB APIS MAKING SENSE
 WITH HYPERMEDIA 1 2 3
  39. 39. WHAT IF WE MADE
 A BETTER API? GUESS WHAT?
 THAT’S WHAT
 EVERYBODY DOES!
  40. 40. 2005 2010 2015 
186 
2,418 
14,368 NUMBER
 OF APIS
  41. 41. 2005 2010 2015 
186 
2,418 
14,368 NUMBER
 OF CLIENTS
  42. 42. HOW CAN WE
 THEN EXECUTE
 UNIFORM QUERIES? WE DON’T.
  43. 43. HOW CAN WE
 THEN QUERY
 MULTIPLE APIS? WE CAN’T.
  44. 44. WHAT IF WE MADE
 A SIMPLER API THAT EXPLAINED ITSELF
 WITH HYPERMEDIA?
  45. 45. “I DON’T DO SERVER ”
  46. 46. “BUT I DO SERVER ”
  47. 47. “SO IF I
 WANT TO DO CLIENT ”
  48. 48. “THEN I NEED
 TO ASK YOU CLIENT ”
  49. 49. “AND COMBINE IT
 MYSELF INTO CLIENT ”
  50. 50. CLIENTS STILL
 ANSWER COMPLEX
 SPARQL QUERIES, JUST NOT WITH
 THE SPARQL API
  51. 51. SERVER TRIPLE PATTERN FRAGMENTS API
  52. 52. SERVER CLIENT SPARQL API TPF API (nothing)
  53. 53. SIMPLE
 SERVER CLEVER
 CLIENT TPF API
  54. 54. 1 240 CLIENTS SPARQL API QUERIES
 PER HOUR TPF API 100 200
  55. 55. SPARQL API TPF API 1 240 CLIENTS100 200 SERVER
 CPU LOAD
  56. 56. SPARQL API TPF API 1 240 CLIENTS100 200 CLIENT
 CPU LOAD
  57. 57. SPARQL API TPF API 1 240 CLIENTS100 200 CACHE
 REUSE
  58. 58. RESPONSES CONTAIN HYPERMEDIA CONTROLS IN JSON-LD USING THE HYDRA VOCABULARY
  59. 59. { "@id": "http://fragments.dbpedia.org/2015/en#dataset", "search": { "template": "/2015/en{?subject,predicate,object}", "mapping": [ { "variable": "subject", "property": "rdf:subject" }, { "variable": "predicate", "property": "rdf:predicate" }, { "variable": "object", "property": "rdf:object" } ] } } JSON-LD
  60. 60. I CAN DO I CAN DO I CAN DO I CAN DO
  61. 61. 2005 2010 2015 
186 
2,418 
14,368 664,368 NUMBER
 OF APIS
  62. 62. 2005 2010 2015 
186 
2,418 
14,368 NUMBER
 OF CLIENTS 
14,369
  63. 63. TRY A SIMPLE SERVER AND A CLEVER CLIENT data.linkeddatafragments.org client.linkeddatafragments.org
  64. 64. PUBLISHING
 LINKED DATA QUANTIFYING WEB APIS MAKING SENSE
 WITH HYPERMEDIA 1 2 3
  65. 65. WHEN DOES
 A CLIENT TRULY HAVE POWER?
  66. 66. IF IT SIMPLY
 USES
 CLEVER APIS?
  67. 67. IF IT CLEVERLY
 USES
 SIMPLE APIS?
  68. 68. IF YOU HAVE THE MONEY,
 USE SPARQL OR GRAPHQL INTELLIGENCE
 IS EXPENSIVE IF NOT, LET EACH CLIENT
 USE ITS OWN CPU
  69. 69. I STOPPED THINKING
 ABOUT WEB APIS
 A LONG TIME AGO I’M NOW THINKING
 ABOUT WEB CLIENTS AND WHEN I SAY WEB,
 I MEAN HYPERMEDIA
  70. 70. I CAN’T MEASURE
 HYPERMEDIA, BUT I CAN MEASURE
 CLIENTS DOING
 THE SAME TASKS
 ON DIFFERENT APIS
  71. 71. HYPERMEDIA LETS
 A SERVER EXPLAIN
 ITS API TO CLIENTS, SO THEY CAN USE IT
 IN MEASURABLY
 DIFFERENT WAYS.
  72. 72. SIMPLE
 SERVERS CLEVER
 CLIENTS @RubenVerborgh Hypermedia APIs that make sense

×