Lee,
You could also create two tables, one which describes a particular
projects column use and another which stores the actual data columns.
The first metadata table would have one row per project and the data
in the second would identify which project they are associated with.
This way you just create a new row for a new project and never change
the table structures. The validations can be driven by the metadata
table specifications.
Brendon.
On Mar 30, 1:45 pm, Lee
<leemagnus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m hoping somebody can give me some direction on how to approach
this
> problem. We have various projects with data acquisition in the field.
> These projects produce time series data of variables such as
> temperature, and power usage. I''m using javascript to plot the
data.
> Currently I have a form in which the user would submit the project
> name, the type of data (60 minute, 1 minute, hourly, etc.) and the
> names of the variables requested. This generates an ajax request to
> find and parse acsvfile to get the variables and send them back to
> the browser to plot.
>
> Thecsvfiles are updated daily. New projects are created often. Each
> project has several types of data with many variables and many rows.
>
> I''d like to have the data all in a database, possibly
ActiveRecord,
> taking advantage of validations and such. I''ve thought of two
> approaches so far:
>
> - Creating a unique new table for every project and for every type of
> data (e.g. data_project1_60minute). This results in creating new
> classes for every table as well, which doesn''t seem optimal. There
is
> also the possibility of using the "set_table_name" feature of
> activerecord, but I wonder if this is the best way.
>
> - Creating one massive table for every type of data (e.g.
> data_60minute, with column names project1_var1, project1_var2,
> project2_var1, etc.). Then adding columns whenever a new project is
> added. This also doesn''t seem great since one data''s
60minute has time
> differences between the others. There is also event driven data which
> collects at high frequency for short periods of time, which also
> doesn''t fit this model.
>
> Really it seems like I want some of the features of ActiveRecord, but
> I don''t really want the object relational mapping, and it gets in
the
> way by requiring me to make a bunch of new classes.
>
> Thanks for any advice that someone can give.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---