In my app I''d like to offer a demo account, so potential users can log in and play around with the system to their hearts content. To prevent the data from becoming too cluttered, I intend to reset the reference data for this account every day. I see two possible options of achieving this, but I''d appreciate some feedback from the group before I dive in: 1. Run a separate instance of the app (probably on a separate machine) using a different database, create fixtures for all my base reference data, and get cron call ''rake db:bootstrap'' every night. This is fairly straightforward but the downside is having to run another server (or VPS) and having a more complicated deployment process. 2. Use the production instance of the app and database and write some explicit code which deletes and reloads the reference data for this account only. This might be more work to set up, is a little riskier, but there is no separate deployment issue since it''s using the production application. The demo account will also be on a production server so there will be performance benefits. There are advantages and disadvantages to both methods, but at the moment I''m more inclined to go for (2). I don''t really think having the reference data in Ruby code rather than YAML is a disadvantage, and I like that fact that deployment isn''t affected -- we deploy the app and the demo account is available automatically. Am I thinking along the right lines or is there a glaringly obvious third way which I''m failing to see? Cheers, Olly. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Andrew Stewart
2007-Jun-21 14:57 UTC
Re: Periodically reloading reference data for a live app demo
On 15 Jun 2007, at 12:49, Olly Lylo wrote:> There are advantages and disadvantages to both methods, but at the > moment I''m more inclined to go for (2). I don''t really think having > the reference data in Ruby code rather than YAML is a disadvantage, > and I like that fact that deployment isn''t affected -- we deploy the > app and the demo account is available automatically. > > Am I thinking along the right lines or is there a glaringly obvious > third way which I''m failing to see?I can''t see a third way -- and I''m inclined to agree that option 2 is a little less messy than option 1. It''s six of one and half a dozen of the other. Sorry for the lack of searing insight! Regards, Andy Stewart --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---