Forum: Ruby on Rails Periodically reloading reference data for a live app demo

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C3c53d4f132fb4ae634e80e501f188f0?d=identicon&s=25 Olly Lylo (Guest)
on 2007-06-15 13:49
(Received via mailing list)
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.
72ee7b478a235f646c3495f03ebbe676?d=identicon&s=25 Andrew Stewart (Guest)
on 2007-06-21 16:58
(Received via mailing list)
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
This topic is locked and can not be replied to.