views:

11

answers:

0

Dear all

I am looking at writing an application that handles time series data and want to shove to heavy lifting data work off into Core Data. My question is this - from a speed of retrieving and ease of manipulation perspective, would it be better to model out the entities or will it likely be easier to 'store' the time series data points as an array that I store as a transformable object (or whatever it's called) in a Core Data object.

For example, assume I have a time stamp and an observation that is associated with only one object I could model the object as one entity, a data point (with attributes time stamp and observation) as another and have the two linked through a one-to-many. My 'uninformed' gut feel is that this may ultimately lead to a performance problem as more objects and their corresponding data points get added since retrieving the data points would effectively be akin to filtering out all entities from the giant pot of data points for which the relationship indicates that they are linked to the target object. Am I misunderstanding how this works? Does Core Data manage this more intelligently in the background and has some clever way to look things up so that performance wouldn't degrade as the number of data points grows? (I presume the whole thing reduces to a very large table in the background, with objects as the key and lots of rows one for each timestamp/observation.)

My other thought to potentially get around the problem is to simply make the time series a bunch of array or dictionary elements and then save the array/dictionary as an attribute on the object itself. I understand that this would take away some Core Data query functionality and may make the UI less 'magic automation'.

Any views on this would be greatly appreciated.

Thank you - C.