top | item 31462050

(no title)

mertnesvat | 3 years ago

Congrats on the launch! I'm also a fan of glitch so congrats on that good job too.

Just out of curiosity have been reading the engineering part and came across with below for not using websockets, confused because debounce and throttle is mainly used to avoid many updates over sockets so it's very well known problem for reactive programming

( https://pketh.org/how-kinopio-is-made.html )

> You might be wondering, why don’t you just update the database with websockets instead of relatively slow API requests?

> The problem with saving data with websockets is that they’re too fast. Authenticating that many messages per second and writing them to disk would be really inefficient. E.g. If you’re moving a card from position x: 20 to x: 420, Kinopio will use websockets to broadcast many updates during the move: moving card x to 21, moving card x to 24, moving card x to 28… potentially hundreds of messages.

discuss

order

pketh|3 years ago

That's a good point, and I should look into that (it's been a while since I touched that part of the codebase). Off-hand my guess is that the other reason I handle api requests separately is because I can group multiple actions into a single request more easily, which isn't something I need to do with websocket streaming