# Periodically reloading reference data for a live app demo

**URL:** <https://www.ruby-forum.com/t/periodically-reloading-reference-data-for-a-live-app-demo/106931>\
**Category:** Rails\
**Created:** [June 15, 2007, 1:49pm UTC](https://www.ruby-forum.com/t/periodically-reloading-reference-data-for-a-live-app-demo/106931 "2007-06-15T13:49:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olly\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/eb8c5e/32.png) [@Olly\_L](https://www.ruby-forum.com/u/Olly_L)\
**Post date:** [June 15, 2007, 1:49pm UTC](https://www.ruby-forum.com/t/periodically-reloading-reference-data-for-a-live-app-demo/106931/1 "2007-06-15T13:49:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Olly\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/eb8c5e/32.png) [@Olly\_L](https://www.ruby-forum.com/u/Olly_L)\
**Post date:** [June 21, 2007, 4:58pm UTC](https://www.ruby-forum.com/t/periodically-reloading-reference-data-for-a-live-app-demo/106931/2 "2007-06-21T16:58:43Z")

</div>

On 15 Jun 2007, at 12:49, Olly L. 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 S.
