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

Building the Real Time Performance Panel

Building the Real Time Performance Panel

Jonathan Balsano

August 09, 2017
Tweet

Other Decks in Technology

Transcript

  1. A Better Experience • New Tool • 10x Higher Granularity

    • Live Experience • Compromise: Ephemeral Data
  2. A Better Experience • New Tool • 10x Higher Granularity

    • Live Experience • Compromise: Ephemeral Data
  3. A Better Experience • New Tool • 10x Higher Granularity

    • Live Experience • Compromise: Ephemeral Data
  4. A Better Experience • New Tool • 10x Higher Granularity

    • Live Experience • Compromise: Ephemeral Data
  5. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server Client
  6. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server DB Client
  7. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server DB DB DB Client
  8. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server DB DB DB Client Customer Network
  9. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  10. Understanding our Architecture L O A D B A L

    A N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  11. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  12. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent I have data!
  13. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent I have data! Pub Sub
  14. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent I have data! Pub Sub
  15. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent Pub Sub I have data!
  16. Ideal Real Time Setup L O A D B A

    L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent Pub Sub I have data!
  17. HTTP vs. Websockets HTTP 1.1 Websockets Request/Response Request from Client

    Client can push, Server cannot Stateless Two way connection Initial Request from Client Server and Client can push Stateful
  18. Pub Sub WebSockets with Load Balancer L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  19. Pub Sub WebSockets with Load Balancer L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  20. Pub Sub WebSockets with Load Balancer L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  21. Pub Sub WebSockets with Load Balancer L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  22. Pub Sub Ops Manager Process Location L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  23. Pub Sub Ops Manager Process Location L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent L O A D B A L A N C E R
  24. Pub Sub Ops Manager Process Location L O A D

    B A L A N C E R Application Server Application Server DB DB Client Customer Network Agent L O A D B A L A N C E R
  25. Solution: Polling L O A D B A L A

    N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  26. Long Polling Server Client Agent Got my data? It’s not

    here. Nap time! Still not here. Nap time!
  27. Long Polling Server Client Agent Got my data? Hey, here’s

    the data! It’s not here. Nap time! Still not here. Nap time!
  28. Long Polling Server Client Agent Got my data? Hey, here’s

    the data! It’s not here. Nap time! Still not here. Nap time! Oh, yeah! Here it is!
  29. Long Polling Server Client Agent Got my data? Hey, here’s

    the data! It’s not here. Nap time! Still not here. Nap time! Oh, yeah! Here it is!
  30. Solution: Long Polling L O A D B A L

    A N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  31. How do we make this... L O A D B

    A L A N C E R Application Server Application Server DB DB DB Client Customer Network Agent
  32. Pub Sub ...behave like this? L O A D B

    A L A N C E R Application Server Application Server DB DB Client Customer Network Agent
  33. Respond ASAP Server Client Agent t = 0 t =

    3000 t = 2000 t = 1000 tReceived = 1020
  34. Respond ASAP Server Client Agent t = 0 t =

    3000 t = 2000 t = 1000 tReceived = 1020
  35. Respond ASAP Server Client Agent t = 0 t =

    3000 t = 2000 t = 1000 tReceived = 1020
  36. Respond ASAP Server Client Agent t = 0 t =

    3000 t = 2000 t = 1000 tReceived = 1020 tReceived = 1020
  37. Respond ASAP Server Client Agent t = 0 t =

    3000 t = 2000 t = 1000 tReceived = 1020 tReceived = 1020
  38. Last Point was at t = 1020 Respond ASAP Server

    Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 tReceived = 1020
  39. Last Point was at t = 1020 Add 1000ms for

    agent Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 tReceived = 1020
  40. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 tReceived = 1020
  41. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 tReceived = 1020
  42. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… tReceived = 1020
  43. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 tReceived = 1020
  44. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 Sleep for 520ms tReceived = 1020
  45. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 Sleep for 520ms tReceived = 1020
  46. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 Sleep for 520ms tReceived = 1020
  47. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 Sleep for 520ms Nailed it! tReceived = 1020
  48. Last Point was at t = 1020 Add 1000ms for

    agent Eh, 100ms for db time sounds good Respond ASAP Server Client Agent t = 0 t = 3000 t = 2000 t = 1000 tReceived = 1020 1020 1000 + 100 2120 What time is it? Oh, 1600 so… 2120 -1600 520 Sleep for 520ms Nailed it! tReceived = 1020
  49. Why? • Marionette • Remove all old views and add

    new child views • Backbone with Handlebars • Wholesale view replacement on every render
  50. Why? • Marionette • Remove all old views and add

    new child views • Backbone with Handlebars • Wholesale view replacement on every render
  51. Why? • Marionette • Remove all old views and add

    new child views • Backbone with Handlebars • Wholesale view replacement on every render
  52. Why? • Marionette • Remove all old views and add

    new child views • Backbone with Handlebars • Wholesale view replacement on every render
  53. Solution: Only Update What’s Changed! • D3 • We already

    have it as a dependency • Our team is already familiar with it • Very intense control over what changes
  54. Solution: Only Update What’s Changed! • D3 • We already

    have it as a dependency • Our team is already familiar with it • Very intense control over what changes
  55. Solution: Only Update What’s Changed! • D3 • We already

    have it as a dependency • Our team is already familiar with it • Very intense control over what changes
  56. Solution: Only Update What’s Changed! • D3 • We already

    have it as a dependency • Our team is already familiar with it • Very intense control over what changes
  57. Three Steps 1. Insert new DOM elements 2. Remove unnecessary

    DOM elements 3. Set attributes on existing DOM elements
  58. Three Steps 1. Insert new DOM elements 2. Remove unnecessary

    DOM elements 3. Set attributes on existing DOM elements
  59. Three Steps 1. Insert new DOM elements 2. Remove unnecessary

    DOM elements 3. Set attributes on existing DOM elements