Home > Technology > Firebase introduction

Firebase introduction

Date post: 25-Jun-2015
Category:
Author: mu-chun-wang
View: 255 times
Download: 7 times
Share this document with a friend
Embed Size (px)
Popular Tags:
of 84 /84
Firebase introduction Kewang
Transcript
  • 1. Firebase introductionKewang

2. 2Live DEMOhttps://db.tt/40igKVhc 3. 3Agenda Variety of sync mechanisms Firebase 4. Variety of sync mechanisms4 5. 5Variety of sync mechanisms Polling Comet Long Polling WebSocket Engine.IO (Socket.IO) Polling & Push 6. 6Pollingsend scheduling request 7. 7Pollingclient server 8. 8Pollingclient serverT0T1T2 9. 9Pollingclient serverT0T1T2T4T5T6 10. 10Pollingclient serverT0T1T2T4T5T6T8T9T10 11. 11Polling Pros Easy to implement Cons No efficiency 12. 12Cometa never died HTTP request 13. 13Cometclient server 14. 14Cometclient serverT0T1 15. 15Cometclient serverT0T1 16. 16Cometclient serverT0T1T3T2 17. 17Cometclient serverT0T1T3T6T2T5 18. 18Cometclient serverT0T1T3T6T8T2T5T7 19. 19Cometclient serverT0T1T3T6T8T12T2T5T7T11 20. 20Comet Pros Save more network traffic Cons Blocking IO issue Always get server response, can't send another request 21. 21Long Pollingsend a long time request repeatedlywhen response received 22. 22Long Pollingclient server 23. 23Long Pollingclient serverT0T1 24. 24Long Pollingclient serverT0T1 25. 25Long Pollingclient serverT0T1T4T3 26. 26Long Pollingclient serverT0T1T4T3T5 27. 27Long Pollingclient serverT0T1T4T3T5 28. 28Long Pollingclient serverT0T1T4T3T5T21T20 29. 29Long Polling Pros Save a little network traffic Can send another request Cons I don't know 30. 30WebSocketFDX communications channelsover a single TCP connection 31. 31WebSocketclient server 32. 32WebSocketclient server 33. 33WebSocketclient serverT0T1T2 34. 34WebSocketclient serverT0T1T2T3T4T5 35. 35WebSocketclient serverT0T1T2T3T4T5T9T10T11 36. 36WebSocketclient serverT0T1T2T3T4T5T17T18T19T9T10T11 37. 37WebSocket Pros Bidirectional communication Save more network traffic Cons Proxy & Firewall issue 38. 38Engine.IOcommunication layer for Socket.IO 39. 39Engine.IO - Socket.IO history0.1~0.6.2 0.6.3~0.6.17 0.7.0~0.9.17 1.0.0~nowwebsocket server-events flashsocket htmlfile xhr-multipart xhr-polling jsonp-polling polling 40. 40Engine.IO - Overview 41. 41Engine.IO - Overview Ensure the most reliable realtime communication 42. 42Engine.IO - Overview Ensure the most reliable realtime communication Always establishes a long-polling connection first 43. 43Engine.IO - Overview Ensure the most reliable realtime communication Always establishes a long-polling connection first then tries to upgrade to better transports that are"tested" on the side 44. Engine.IO - Upgrade transport seamlessly44 45. Engine.IO - Upgrade transport seamlessly45 Switches from polling to another transport inbetween polling cycles 46. Engine.IO - Upgrade transport seamlessly46 Switches from polling to another transport inbetween polling cycles To ensure no messages are lost, the upgrade packetwill only be sent once all the buffers of the existingtransport are flushed and the transport isconsidered paused 47. 47Engine.IOclient server 48. 48Engine.IOclient serverT0T1 49. 49Engine.IOclient serverT0T1 50. 50Engine.IOclient serverT0T1 51. 51Engine.IOclient serverT0T1T6T5T7 52. 52Engine.IOclient serverT0T1T11T6T5T7T10 53. 53Engine.IOclient serverT0T1T11T6T5T7T10 54. 54Engine.IOclient serverT0T1T5T7T11T6T12T13T14T10 55. 55Engine.IO Pros Auto-switch different network scenario Cons Use particular protocol at server & client 56. 56Polling & Pushsimple sync mechanism 57. 57Polling & Push - Push offclient server 58. 58Polling & Push - Push offclient serverT0T1T2 59. 59Polling & Push - Push offclient serverT0T1T2T4T5T6 60. 60Polling & Push - Push offclient serverT0T1T2T4T5T6T8T9T10 61. 61Polling & Push - Push onclient server SNS 62. 62Polling & Push - Push onclient serverT0T1T2SNS 63. 63Polling & Push - Push onclient serverT0T1T2T22T23T24SNS 64. 64Polling & Push - Push onclient serverT0T1T2T22T23T24SNST30 65. 65Polling & Push - Push onclient serverT0T1T2T22T23T24T31T32T33SNST30 66. 66Polling & Push Pros Easy to implement Cons No (official statement) 67. 67Firebase 68. 68Firebase Save data in the cloud Realtime Data Easy authentication Bulletproof Security Instant Scalability 69. 69Pattern 1 - Client Only 70. 70Pattern 1 - Client Only Developing a brand new application Needs minimal integration with legacy systems orother third party services App doesnt have heavy data processing needs orcomplex user authentication requirements 71. 71Pattern 2 - Client & Server 72. 72Pattern 2 - Client & Server To integrate with third party APIs Advanced authentication requirements Cant run computationally intensive code on aclient, or requires code to run on a trusted server 73. 73Pattern 3 - Existing App 74. 74Pattern 3 - Existing App An existing full-featured app, and arent planning arewrite Codebase is large and cannot change Add realtime features without touching the rest ofapp 75. 75Live DEMO2 76. 76FAQ 77. 77FAQ Enterprise solution 78. 78FAQ Enterprise solution Custom SLA 24*7 support Dedicated clusters Training 79. 79FAQ Enterprise solution Custom SLA 24*7 support Dedicated clusters Training Concurrent connection 80. 80FAQ Enterprise solution Custom SLA 24*7 support Dedicated clusters Training Concurrent connection Free plan has 50 max connections, otherwise isunlimited 81. 81FAQ Enterprise solution Custom SLA 24*7 support Dedicated clusters Training Concurrent connection Free plan has 50 max connections, otherwise isunlimited Lock-in 82. 82FAQ Enterprise solution Custom SLA 24*7 support Dedicated clusters Training Concurrent connection Free plan has 50 max connections, otherwise is unlimited Lock-in Export data to JSON 83. 83References Browser Server Comet (programming) Engine.IO: the realtime engine Engine.IO Protocol How Firebase Works Firebase Callbacks - what's the underlying trigger? Firebase under the hood - watching web sockets inChrome Developer Tools 84. 84


Recommended