-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket.io compatibility with cube.js #221
Comments
I was evaluating the same thing. I would give my 2 cents on the topic suggesting the use of cossbar's Autobahn, since it is a well performing and multi-{platform|language} alternative to socket.io |
@rizvanhaider @nicodds Hey Rizwan and Domenico! Thanks for posting this! As it's ongoing conversation I'll put some more context info here. In general most of databases supported by Cube.js are retroactive. It means databases usually don't support any push/subscription mechanism to listen for changes of underlying data. So to implement some sort of push/subscription behavior for clients cube.js backend should constantly poll databases for changes. Refresh key concept pretty well suited for that: https://cube.dev/docs/caching#in-memory-cache-refresh-keys. So in order to implement it I think we need to decide on how should we define polling interval: should it be defined by client or server? Per cube or global? @rizvanhaider @nicodds Would love to hear more about your socket push/subscriptions use cases to better understand what type of configuration it requires. |
Ciao @paveltiunov, thank you for the reply! My initial idea was to evaluate the possibility of integrating some sort of pub/sub component in cube.js backend. This integration may be used in two different ways:
|
@paveltiunov Thanks Pavel for your detailed response. Consider our own implementation of tracking users on our website and every new user make an increment in database (table => cube => dimension/measure), so If we want to see the real time figures via our cubejs api I think we need to implement it on specific cube and on specific measure/dimension. Also it should be defined by server so client should know it via subscription. |
@nicodds @rizvanhaider Cool! What DB do you use? |
Actually I use an custom hybrid solution built on a Bokeh (python) application with data read both from a sqlite file (pre-aggreations) and BigQuery. Updates are received by the application via Google Pub/Sub and sent via web sockets to the clients. Unfortunately, this solution is hard to maintain (Bokeh, although an interesting project, has a complex approach to build an application) and difficult to scale. |
@nicodds Got it! Do you plan to use external rollups https://cube.dev/docs/pre-aggregations#external-rollup? If so which DB? |
currently I am using MySQL. |
@rizvanhaider @nicodds Hey Guys! We released sockets support for preview. In order to use it just enable it on backend using env variable:
On client side we added
We provided just simple reference implementation using low level We're open to various socket transport contributions and if you feel you need particular socket transport we can guide you on how to build it. Could you please try it and let me know if it's helpful? |
That is super-cool! I'll give it a try ASAP! |
Is there any way to create the real-time charts with cubejs? compatibility of Socket.io or real-time data with cubejs will be a great feature because most analytics needs real-time data.
The text was updated successfully, but these errors were encountered: