invisible-college / statebus

All aboard the STATEBUS!!!
117 stars 5 forks source link

How would things like infinite scrolling work? #44

Closed balupton closed 3 years ago

balupton commented 3 years ago

In 2013 I set out to build a project called Interconnect however the tech wasn't available for a indie developer to do it at the scale necessary at the time: notably, a live face wall of thousands-to-millions of live webcam feeds of users. Statebus seems possible to make that happen (akin to that webcam demo video on the homepage, but x1000).

I am left wondering though, if can it scale from say one webcam feed to a thousand, such a page would need to do infinite scrolling as well as purging of elements that are off screen while keeping a semblance of scroll position.

I imagine that statebus allows us to connect a specific DOM tree, or say a variable to a remote state to be synchronised, however the entire DOM tree, nor the entire variable state needs to be synced. One would just use whatever typical infinite-scroll + purge library they're use to using, and then just remote sync each webcam feed.

Performance could further be enhanced by coalescing webcam feeds into say a "sprite" state, which with statebus's magic, wouldn't just be a typical image sprite, but also a DOM sprite. So say a hundred live feeds and their DOM can be coalesced into shared sync state, assembled from dozens of server-to-server shared sync states of individual feeds. So say 100,000 video feeds, would reduce into say 1,000 feed segments (and how it is reduced can be up to say a search filter and sort order, of which popular ones are done).

Is this a somewhat accurate understanding of how one would implement statebus?

balupton commented 3 years ago

Browser screwed up on submission, closing for the newer duplicate: https://github.com/invisible-college/statebus/issues/45