Frank Guerino
2012-Feb-24 00:18 UTC
Question About Incremental and Ongoing Seeding of Database Throughout Application Life Cycle
Hi, I have a question about how best to handle "ongoing" and "incremental" seeding of a database, after the application is built. Summary of Application: I need to build a multiple choice testing application where, in short, each Question has four Answer Choices. A "User Specific Test" will consist of 200 randomly selected Questions from a Catalog that contains thousands of Questions. There are other constructs that handle things like Test Results, etc. Rails seems to handle the model pretty well. Summary of the Issue: The requirement is that as new Questions and their correlating Answer Options get created, about 100 per month, they need to be loaded in bulk into the database, through an automated means. The key is not to disrupt anything that already exists in the database and automatically make the new Questions discoverable via the Catalog. Is there a clean way to handle this with Rails? I''ve been skimming through things like Fixtures but don''t know enough about them to understand whether they''d help. Thanks, in advance, for any help you can offer. Frank -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
3dd13
2012-Feb-24 02:34 UTC
Re: Question About Incremental and Ongoing Seeding of Database Throughout Application Life Cycle
one option: - build rake task to import data - and use schedular or background job to run it regularly On Feb 24, 2012 8:18 AM, "Frank Guerino" <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:a> > Hi, > > I have a question about how best to handle "ongoing" and "incremental" > seeding of a database, after the application is built. > > Summary of Application: I need to build a multiple choice testing > application where, in short, each Question has four Answer Choices. A > "User Specific Test" will consist of 200 randomly selected Questions > from a Catalog that contains thousands of Questions. There are other > constructs that handle things like Test Results, etc. Rails seems to > handle the model pretty well. > > Summary of the Issue: The requirement is that as new Questions and > their correlating Answer Options get created, about 100 per month, they > need to be loaded in bulk into the database, through an automated means. > The key is not to disrupt anything that already exists in the database > and automatically make the new Questions discoverable via the Catalog. > > Is there a clean way to handle this with Rails? I''ve been skimming > through things like Fixtures but don''t know enough about them to > understand whether they''d help. > > Thanks, in advance, for any help you can offer. > > Frank > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email torubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org> For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.>-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2012-Feb-24 08:50 UTC
Re: Question About Incremental and Ongoing Seeding of Database Throughout Application Life Cycle
On 24 February 2012 00:18, Frank Guerino <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I have a question about how best to handle "ongoing" and "incremental" > seeding of a database, after the application is built. > > Summary of Application: I need to build a multiple choice testing > application where, in short, each Question has four Answer Choices. A > "User Specific Test" will consist of 200 randomly selected Questions > from a Catalog that contains thousands of Questions. There are other > constructs that handle things like Test Results, etc. Rails seems to > handle the model pretty well. > > Summary of the Issue: The requirement is that as new Questions and > their correlating Answer Options get created, about 100 per month, they > need to be loaded in bulk into the database, through an automated means. > The key is not to disrupt anything that already exists in the database > and automatically make the new Questions discoverable via the Catalog. > > Is there a clean way to handle this with Rails? I''ve been skimming > through things like Fixtures but don''t know enough about them to > understand whether they''d help.I use a script in db/seeds.rb to accomplish a similar task. I have a cron job that prepares the data and then runs rake db:seed to update the db from the source data. In fact all that seeds.rb does is call model methods to do the import. Colin> > Thanks, in advance, for any help you can offer. > > Frank > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. >-- gplus.to/clanlaw -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.