1

I am developing real-time interactive visualization, using meteor and react on the front-end. The visualization which is fairly complicate to initiate, but relatively easy to update with atomic changes. Thus, I need to fetch the data once, transform the data, compute layout and then observe (atomic) changes on the data and update the visualization.

My problem is: How shall I handle the case, when changes occurred on the data in the time, between the the time the data was fetched, transformed and the visualization was initialized and the time we start to observe for changes ?

|---(subscription-ready)---(fetch)---(transform-data)---(compute-layout)----------------------------->

|---(subscription-ready)---------------------------------------------------------------(observe-changes)--->

|---------(change1)---------(change2)---------------------------------------------------------------------------->

I was thinking about starting the change-observation first, saving an timestamp right before I start to observe the data, fetching the data, transforming and computing the layout afterward and queuing all the changes till the moment the visualization is ready.

karlitos
  • 1,604
  • 3
  • 27
  • 59
  • Our app that we built recently kind of does what you mentioned. We do meteor method calls to the server on initial render to fetch the data and later observe changes after few seconds. We were initially using pub/sub, but when the data grew, we ended up having loads of data to be processed on the client side, which slowed down the rendering process a lot. So we switched to server-side methods and call them on observe changes as well. – Sudheer Jami Nov 30 '18 at 16:06
  • Hi, and many thanks for you reply! My application should be real-time and collaborative, so I need real-time updates I can not allow to miss any data. So how do you deal with the issue, that changes may occure between initial fetch and the time the data is processed and you start observing for changes? I am pursuing following pattern now: first start to observe for changes, than fetch the data, transform and store any changes in a queue. Then I will update the data stored in the queue, if any new changes appear, I will put them in the queue as well – karlitos Nov 30 '18 at 17:07

0 Answers0