11 ms·
You already mention Materialize -- have you looked at the SUBSCRIBE feature? https://materialize.com/docs/sql/subscribe/ https://materialize.com/docs/sql/subscr
by roshanj 2y ago
You already mention Materialize -- have you looked at the SUBSCRIBE feature? https://materialize.com/docs/sql/subscribe/ https://materialize.com/docs/sql/subscribe/
It's fairly straightforward to write a websocket endpoint in whatever backend you have that issues a SUBSCRIBE query on connect and then continuously forwards the updates to the client. The complicated parts you'd need to build are on the frontend -- handling updates and merging them into whatever state you render from.
Disclaimer -- I work at Materialize -- but it does seem like the perfect fit for what you need (efficiently updated real-time materialized views).
- bruchim 2y agoThanks! > It's fairly straightforward to write a websocket endpoint in whatever backend you have It indeed solves half of the problem, but managing websockets for thousands of users is not that trivial IMO
- fernandotakai 2y agoyou should try phoenix channels https://hexdocs.pm/phoenix/channels.html https://hexdocs.pm/phoenix/channels.html they scale really really easily for millions of users.