1

I have a SaaS app with models such as

Company  
User
Project
Task

To demo the app for prospective customers I want to create demo accounts with sample data, e.g. 1 company, 25 users, 10 projects, 200 tasks.

I will create perhaps 5 demo accounts per day (online, not locally) and then destroy them by the end of the day.

Any suggestions how to handle this? My dream solution would be to use the code I already have, but not save the demo data in the same tables as the real customers.

Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
  • If you want to separate your demo data from real data then one solution can be to use different databases – Mandeep Sep 11 '14 at 16:09
  • Would you care to elaborate how such a setup could look like? – Fellow Stranger Sep 11 '14 at 16:32
  • 1
    if you are using heroku then checkout http://stackoverflow.com/questions/7677544/how-to-use-multiple-databases-for-one-rails-3-1-app-in-heroku – Mandeep Sep 11 '14 at 16:39
  • 1
    Another solution could be to host your app on multiple servers. One as your main production app with real data and other one as staging with your demo data – Mandeep Sep 11 '14 at 16:48

2 Answers2

1

My dream solution would be to use the code I already have, but not save the demo data in the same tables as the real customers.

As i said in my comments, you have two options:

a. Use different database: This one is tricky because if you are using Heroku then it doesn't allow you to specify your database. For that can checkout how to use multiple databases for one rails app

b. Have different servers: You can host your app on two different servers. One of them can be used as a main production app with the real data and the other one can be used as staging with your demo data. Checkout this post and this for details on staging environment and how it can be useful.

PS. It may look cumbersome to use two different server but i think it's a better idea than to hack and make heroku use two different databases

Community
  • 1
  • 1
Mandeep
  • 9,093
  • 2
  • 26
  • 36
0

You could always use two separate databases and then drop the test database once the app is being released.

Grant
  • 446
  • 6
  • 24