Hacker News new | ask | show | jobs
by bionhoward 792 days ago
Noria sounds like what you mention with materialized views, but it’s a server side rust thing, might be pretty heavy. https://docs.rs/noria/latest/noria/

Consider Server Sent Events as an alternative to sockets because this lets you keep Client events restful instead of doing everything on sockets.

https://developer.mozilla.org/en-US/docs/Web/API/Server-sent...

Might be wise to make a “sync” service? Make sure your client has a local database in indexeddb and listen for server events with data updates, apply the event to the database, and use stale-while-revalidate to double check data (perhaps debounce revalidation substantially unless you have extremely dynamic data)

One idea would be to use redis queues to hold server events, let clients subscribe to the redis, don’t let them touch the DB behind the server, then it’s less of a push and more of a pull when client is ready

1 comments

What’s the downside with sockets that makes you want to keep events RESTful?