Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The end of polling APIs?

The end of polling APIs?

More Decks by API Strategy & Practice Conference

Other Decks in Technology

Transcript

  1. Sensory  memory                Length:

     0,5s  for  video                                            2  sec  for  audio   Short-­‐term  memory                  Length:    30  secondes   Long-­‐term  memory  
  2. 5   Reac=on  =me   of  an   applica=on  

    Impact  /   Feeling   0,1   Secondes   0,5   2   3   5   10   1   4   «  Slow  »   40  à  60%  drops   on  desktop  web   «  Very  slow  »   30  à  40%  drops   on  mobile  web   Loss  of  aMen=on   Nervousness   Tiredness   «  Regular  »   «  Instant  »   Perfect  (eq.   Human   Real=onship)   No  wai=ng  
  3. -100 ms = - 1% revenue & - 5% page

    views Source  :  h4p://blog.radware.com/applica?ondelivery/applica?onaccelera?onop?miza?on/2013/06/web-­‐performance-­‐poverty-­‐line/   Source  :  h4p://www.ebaytechblog.com/2013/03/29/measuring-­‐real-­‐user-­‐experience-­‐with-­‐site-­‐speed-­‐gauge/#.VFIHLvTF9CN   Source  :  h4p://www.webperformancetoday.com/2011/11/08/velocity-­‐faster-­‐mobile-­‐sites-­‐business-­‐kpis-­‐case-­‐studies/  
  4. Round Trop Delays (ping time) 300   150   110

      100   30   25   10   0   50   100   150   200   250   300   350   EDGE/2G   3G   4G   Trans-­‐con?nental  op?c  fiber   Trans-­‐country  op?c  fiber   ADSL   In-­‐town  private  network   In  ADSL,  first  useful  piece  of  data  in  60ms  (HTTPS)   In  4G  /  LTE,  first  useful  piece  of  data  in  300  ms  (450  ms  in  3G)   Exc.  RRC   (Radio   Resource   Controler)  
  5. Latency requires a global approach Percep=on   Network  latency  

    Bandwidth   Data  requirements   Protocols   API  calls  
  6. Dynamic data for your UI •  Stock  prices  &  be]ng

     odds   •  Social  networks  info  /  status   •  Search  op=ons  /  words   •  News   •  Stock  of  services  /products                            (Sharing  economy  &  promo?ons)   •  Prices   •  Dashboard                            (Cash,  Sales,  …)   •  Collabora=ve  works/inputs                            (chats,  texte,  drawings,  …)   •  Online  games                            (Leader  boards  &  in-­‐game  info)   •  …  
  7. Netflix Note  :  Table  size  ó   device  screen  

    JSON  Path  +  cache  local  +  polling   op?mized  query   h4p://www.infoq.com/presenta?ons/neclix-­‐reac?ve-­‐rest  (Jafar  Husain)  
  8. Standard for incremental data : JSON Patch h4p://jsonpatch.com/   {

    "baz": "qux", "foo": "bar" } [ { "op": "replace", "path": "/baz", "value": "boo" }, { "op": "add", "path": "/hello", "value": ["world"] }, { "op": "remove", "path": "/foo"} ] The original document The patch { "baz": "boo", "hello": ["world"] } The result
  9. Solutions for dynamic data Browser   support   Web  infra

      compa=bility   Easiness  to   dev   Load   (network  /   Device)   Down   stream   App  latency   Polling/ Long  Polling   Websocket     SSE    
  10. Demo with Xignite Currency Feed https://globalcurrencies.xignite.com/ x G l o

    b a l C u r r e n c i e s . j s o n / G e t R e a l T i m e R a t e ? Symbol=EURUSD,USDGBP,EURJPY, CHFDKK&_token=0DE1CAA203374B AEAABDF10B42610FC1 http:/proxy.streamdata.io/https:// g l o b a l c u r r e n c i e s . x i g n i t e . c o m / x G l o b a l C u r r e n c i e s . j s o n / G e t R e a l T i m e R a t e ? Symbol=EURUSD,USDGBP,EURJPY, CHFDKK&_token=0DE1CAA203374B AEAABDF10B42610FC1
  11. h4ps://api.uber.com/v1/es?mates/?me?   start_la?tude=33.9799396&   start_longitude=-­‐118.3343132&   server_token=   LNiO_-­‐ f8xKfUM4qPDYnX4UbCNxSQd061k1NIhfLK

          h4ps://proxy.streamdata.io/   h4ps://api.uber.com/v1/es?mates/?me?   start_la?tude=33.9799396&   start_longitude=-­‐118.3343132&   server_token=   LNiO_-­‐ f8xKfUM4qPDYnX4UbCNxSQd061k1NIhfLK   URL api Uber
  12. Conclusions •  App latency objective : 0,5 sec •  Enable

    dynamic data display •  « The more others invest in amazing UI, the more yours seems louzy » A.  Einstein « Relativity concepts applied to UI », OpenRoadMedia, 1937 •  Become Streamers !