Push bitmap to clients in realtime
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?
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.