analytics - MongoDB For Trending Data -


I have an app in which by adding customer field Are there. We are considering tracking data for these custom areas. I was thinking about storing data in a format that contains the changes listed on the object.

  {_id: "id", custom1: 2, changes: {'2011-3-25': {custom1: 1}}}   

It should be clearly below the maximum document size (16 MB) which I feel is within the amount of changes that we have to make.

Another option will have several records for each object change :

  {_id: "id", custom1: 1, changeTime: '2011-3-25'}   

There is no document restriction, but To get the full change set for the record More work will be required, but more will be recorded.

Who would you like to choose?

I would like to go down a document root if this will stay within the 16MB limit like this , To read this record, only one is read and all its changes are made, which should be darn very quickly. Changes listed in the document seem to be a natural way to model data.

In such circumstances, especially if I have not done anything before, I test a benchmark approach - in this way, the professional / opposition / performance of each approach presents itself to you and (Hopefully) gives you confidence in the approach you choose.

Comments