by RubyPinch · 10y ago · 0 comments
> On the database side, I separate the snaps into a few different collections: all snaps, most liked snaps, newest snaps, newest valid snaps and so forth.
Pardon my ignorance, but don't most databases have some method of handling these issues?
(defining multiple indexes for use, having support for geospatial data, having support for like, subsections of the existing dataset, etc?)
I thought that the main goal was to offload the developer's code's logic onto the performant database, as opposed to offloading the database's logic and caching onto the developer's code? is the former not practical?
Channel position/calculation can happen client side, and subscribe/unsubscribe can happen server-side. Though that may leave room for unscrupulous behavior, it could be locked down a bit more by moving sub/unsub server-side.
The issue will be growth/routing/rerouting of channel data... even then, you can get pretty far with RabbitMQ backed socket.io ... you might need to custom create something before hitting 10M simultaneous users, which at current growth rate would be an issue anyway.
But if you can live with that, then yes, you're unlikely to have actual scaling problems - at least not for projects like the OP.
No need to manage separate collections.