On the model side, to facilitate a generic visualization layer, you could also consider an abstract parent class where you standardize time series information that isn't the data.
For my time series data, I have this:
I built a few django time-series models, then started to abstract out the parts that were the same across the models. This includes:
- a Time_Period model to hold a set of defined time periods, if your time periods are more complex than simply time increments (for example, I did time-series of reddit activity within subreddits, broken out by hour, and also categorized into being within 14 days before and after a certain date - so before-1, before-2, before-3, ..., after-1, after-2, after-3, ...).
- an AbstractTimeSeriesDataModel that includes basic information on a time period (start and end datetime, time period index, a separate aggregate index in case you have something like my before and after, and so have after-1, which is actually number 327 overall, etc.), plus the ability to set and hold ten different generic filters (so you can mark a given time period as having contained links to news, for example, using filter_1, and store a count of matches within the period in match_count_1, or use filter_2 and match_count_2 to note a particular time-series period had X posts related to a particular topic), and base methods for doing a lookup and retrieving an instance.
Then, for a particular data set, you extend this abstract class and add in columns you want to track within a given time period (see
https://github.com/jonathanmorgan/reddit_data for an example - the model Subreddit_Time_Series_Data is a much more complete example than Domain_Time_Series_Data).
An abstract base class like this would give you the common elements of time-series data on which you could start to build a generic visualizer, and also then give you the flexibility to add data as needed. You could probably just use a simple naming convention to reveal added columns as data ("tsdata_").
You could also probably add generic data fields to this abstract model, but it didn't seem to be useful for me when I built this, since I was capturing many fields per time series, and I kept having to add fields as our research led to more questions.
Also worth noting, if you go with a relational database (I personally like relational databases for complex, relational data) and might have millions of rows, postgresql is much easier to get reasonable performance out of than mysql.