Reputation: 1106
I have a time series data, for example myData, and display it to my ui, it could be Day, Week, Month, Year.
How it's better to store in MongoDB, should I create separate Collections for this like: myDataDay myDataWeek ...
or it's better to store it in one Collections with Day, Week, Month, Year keys?
How could it impact the performance?
Upvotes: 0
Views: 30
Reputation: 10727
You will need to answer following questions:
If you split the data between many collections logic on app side will become more complex , from the other hand if you keep everything in same collection at some point in time your database will become bigger and more difficult to mantain...
You may take a look to the special collection types dedicated to time series data , but in general it very depends on the amount of data and and distribution you expect ...
Upvotes: 1