> On Jan 20, 2016, at 2:04 PM, Usman Shahid <usman.shaa...@gmail.com> wrote:
> 
> Hi Everyone,
> 
> I've to design a system in which different datasets are added periodically to 
> the system and user should be able to perform several predefined set of 
> operations on the data. Datasets are large enough so it makes sense to keep 
> them in separate tables/databases for performance reasons.
> 
> The problem I'm facing is that how does it fit into rails ActiveRecord 
> architecture. Do I generate new Models for newly generated tables every time 
> a new dataset is added? Suppose even if i'm able to somehow do that, I still 
> need to provide a generic interface for all datasets. I'm not sure what the 
> architecture should look like while following the rails conventions? Also it 
> is preferable to add new datasets without having to worry about changing the 
> code.
> 
> Any kind of help will be appreciated

I would take a serious look at views or materialized views, if these are 
reporting data rather than something your users will be adding rows to. That 
would let you abstract away the implementation details of the database layer 
from your application. You have a single stable model, and its "table" is a SQL 
view of one or more actual tables in the DB. We use this all the time for 
read-only data.

Walter

> 
> Regards,
> Usman
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/c9a62d62-46f9-4a9b-b47a-d2729836d9d2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/7FF384F3-C797-4795-9066-9E7470248228%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to