Socket Clusters with Pub Sub on Cloud

294 Views Asked by At

I am creating a Transport Layer to frontend for a webApp. Users could be connected over Mobile Apps, Browser both. The Transport Layer is frontending for multiple Applications which includes Chat Applications, Multi Page Web Applications, Notification and Email Servers. Scale is around 4000 Concurrent Users. Few Scenarios Different Services might also need to interact with Each Other. e.g Chat Server might Send an Email.

I am looking for the best Design for this Transport Layer. Whole System needs to be deployed on Cloud but needs to be Vendor Independent.

My Design: 1. Create Sockets via NettoSphere (https://github.com/Atmosphere/nettosphere) or Netty with FallBacks for HTTP Polling. 2. Connect Socket Layer with a Pub/Sub like Redis(for now Using Cloud's Pub/Sub). Each Functional Server(Email,Chat etc) gets its own Channel.

Doubts: 1. Am i Overkilling it? Are there any ready of the Shelf Libraries I can use? I have searched but couldn't find. I feel this should be a common Use Case and there should be something off the shelf. 2. For Java, will Nettosphere scale across Clusters? Or Should i be using SocketCluster in Node.js. I am more comfortable in Java.

1

There are 1 best solutions below

0
On

Simple pub/sub isn't too difficult to implement yourself from scratch using WebSockets.

But once you introduce an authentication and/or scalability requirement, then the problem becomes very difficult. If you feel that your system is likely to need any of these two features then SocketCluster should save you a lot of time.