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

Leveraging Firebase for Scalable Real-Time Appl...

Avatar for Oluwole Adebiyi Oluwole Adebiyi
November 23, 2024
130

Leveraging Firebase for Scalable Real-Time Applications

Avatar for Oluwole Adebiyi

Oluwole Adebiyi

November 23, 2024

Transcript

  1. Leveraging Firebase for Scalable Real-Time Applications: A Smarter Alternative to

    WebSockets Ibadan Program Manager | Moniepoint Oluwole Adebiyi
  2. An Express Server A simple Frontend App (React for this)

    Firebase for realtime notification What are we going to be using?
  3. Real-Time Data Flow Across Terminals POS Transfer Backend Microservice Firebase

    Realtime DB 1 POS - 1 Firebase Realtime DB 2 POS - 200K POS - 201K POS - 400K
  4. Ibadan Setup: Each POS terminal is seen as a connection

    to Firebase. Firebase supports up to 200K connections per database instance, automatically handling 200K terminal connections.
  5. ( 1 ) Firebase Real-Time Database (1/2) Effortless Scaling: Supports

    200,000 simultaneous connections per database instance out of the box. - No manual infrastructure configuration required—Firebase manages all connections seamlessly. - Automatic handling of connection states, offline storage, and reconnection, saving considerable setup and maintenance time.
  6. Firebase Real-Time Database (2/2) ( 2 ) Minimal Expertise Required:

    Simply integrate Firebase into your app, and it handles scaling, connection management, and concurrency for you. ( 3 ) Built-in Offline Handling: Firebase ensures that data syncs whenever a device reconnects, automatically managing offline/online states.
  7. ( 1 ) WebSockets (1/2) Server Infrastructure: You need to

    configure, deploy, and maintain load balancers, WebSocket servers, and connection pools. ( 2 ) Scaling Across Server: Reaching 200K connections typically requires multiple servers, each with dedicated WebSocket services, and a robust load-balancing system
  8. ( 3 ) WebSockets (2/2) Resource-Intensive Monitoring: Monitoring, troubleshooting, and

    optimizing WebSocket connections at this scale requires significant expertise and ongoing maintenance. ( 4 ) Offline Handling Limitations: WebSockets do not natively handle offline scenarios. Custom logic is required to detect disconnections, queue data, and retry upon reconnection.
  9. Ibadan Example Comparison: Firebase: One database instance scales effortlessly to

    200K POS terminals, with managed, automatic scaling and reconnections—no infrastructure knowledge or server maintenance required. WebSockets: Achieving 200K connections would require: • Load Balancers: To distribute connections across multiple servers. • Multiple WebSocket Servers: Each capable of handling only a fraction of the connections, requiring complex infrastructure and tuning. • Custom Reconnection Logic: Building mechanisms to detect and handle offline situations, which Firebase does automatically.
  10. Ibadan In Conclusion Firebase offers a hassle-free, highly scalable alternative

    to WebSockets, perfect for extensive real-time applications like POS networks, without the need for advanced server management expertise.
  11. Source: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis

    non erat sem Workshop https://github.com/kingflamez/gdg-ib