Ask A Question

Notifications

You’re not receiving notifications from this thread.

Push bitmap to clients in realtime

Ilya Cherevkov asked in General

Hi Chris!

I want to create a service which will show a heatmap with some stocks data in realtime (updated each second). Each second there will be around 100 new data points and in general, chart may contain up to 30 000+ data points. Do you think that creating separate process for data connector (e.g. http://michalorman.com/2015/03/daemons-in-rails-environment/) and pushing data through redis (action cable) to rails application, where .js will generate bitmap is optimal way to go? (https://neil.fraser.name/software/bmp_lib/). Or is it better to let js fetching data directly from the browser?

Reply

I definitely would imagine that using ActionCable for this would make the most sense. The trouble you're going to run into is the amount of data you need to stream and how often would conflict with polling in any sense. It'll be best in a situation like this to have open connections that you can just push data over to instantly whenever necessary. If you did JS fetching, you'd have to wait for the connection to open each time which would be too much overhead for fast performance on updates in a situation like this.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.