by plaguuuuuu · 3y ago · 0 comments
I have a side project in mind where IoT devices (dropping in and out of 4G and/or ad-hoc wifi or bluetooth) need to communicate and send/receive events, reconciling with event sourcing or whatever
The tough parts of the architecture for this seem pretty generic so I'm hopeful that something already exists!
I had a lot of fun abusing this to make a serverless[1] video streaming platform. The video streaming ended up being shit with fundamental issues I don't think I could solve. but it was fun to put together the proof of concept.
1. actually serverless. not "the server is in the cloud" bullshit people usually mean when they say serverless.
How did they solve or work around what you couldn't solve?
Curious due to some deeply engrained dislike of anything centralized :p
The theory was to listen to an incoming video stream chop it into 2-3 mb segments and publish each segment via ipfs, the program then notifies everybody watching what the next segment is via a signed ipfs pubsub message.
To watch a stream you get your streamers public key(so you can identify their segment messages are valid) and subscribe to their ipfs pubsub channel. as the software gets segment messages it downloads the segments via ipfs and reassembles the video.
Theoretically it would scale automatically to the population of people watching the stream. with the watchers providing the scale infrastructure.
realisticly ipfs pubsub does not scale but the real problem was the lag. the lag started at around 2 minutes and went up rapidly. My impression is that streamers value interactivity with the watchers and would not tolerate such a large lag.
My proof of concept code. it is very primitive, no ui, designed (both client and server) for the user who enjoys a unix style environment. I think about trying to finish it every now and then but have not yet found the motivation.