Hacker News new | ask | show | jobs
by danenania 4046 days ago
Beginner question: how does Meteor handle storing server-side web socket connections in a scalable way? Are they kept in ram? Redis? Mongo's ram?

The complexity of this is why I always end up reaching for hosted WS solutions like pusher or fanout.io.

1 comments

Why is this complex? There are so many ways for pub/sub implementations.

However I always ended up using Playframework for WS, since it's really really easy to set this up in a scalable way.

WS are fundamentally more complex than HTTP since connections are stateful and that state needs to be stored somewhere. It's another dimension that needs to be properly distributed and load balanced to be scalable.

It's not something you need to worry about for small applications, but for a scalable architecture, it's important to know the details of how this works. What happens to Meteor (or Play) with 100k simultaneous connections? How much ram and how many servers will I need? How do I load balance WS data between them? Will another datastore like redis be required? If so, how does it integrate with the framework? What if I outgrow a single instance of that datastore?

If I use pusher, I don't have to think about any of this.