You are here: Forums Ask a Rails expert Deployment Question...
Posted in Forums : Ask a Rails expert
Authority 0
Posting Rating 0
Sign in to rate this post
|
I’m new to Rails, and currently working on a pretty big Rails SaaS product. It has 30 or so Models and 15 or so Controllers. I’m wondering how I’m going to deploy this. Currently, the product is based off a single implementation…meaning, that for every customer I have, there will be a separate implementation and separate database(not sure if that makes any sense). To put it another way…in .NET (I’m a .NET developer), for every customer, I would have a separate virtual directory. The application will sit in that VD and the configurations will point to their own database in SQL Server. For my Rails app, I would like to have each customer have their own MySQL database, and the database.yml file will point to the specific target database. How would you separate each instance of the application for each customer? Is it even possible with Rails? |
Authority 37
Posting Rating 94
Sign in to rate this post
|
You can use “establish_connection” in your model to connect to different databases depending on the each customer. |
Authority 37
Posting Rating 0
Sign in to rate this post
|
What I have done in the past is to have one deployed application per customer; using Capistrano and its multi-stage extension I would create one deploy file for each new customer. On another note, I recall DHH being somewhat against the “one database per deploy” schema, arguing it could turn into a maintenance nightmare. He seemed to favor the scoped approach—where each customer would map to, say, an account, and everything could belong to that account (foreign key). |
Authority 25
Posting Rating 60
Sign in to rate this post
|
Hello, you can use one capistrano deployment by user, but if you have a lot of user it will be quickly difficult to maintain all these instances. Nicolas |
Ask a Rails expert : nested application ApplicationController get called intead of children::ApplicationController
Ask a Rails expert : Best way to structure a database for a large/static dataset
Ask a Rails expert : Ruby Developer (ROR) - Scottish based (Remote working from within the UK)
Ask a Rails expert : Above Ground Pool Supplies
Ask a Rails expert : How to get url params in observer or model in Rails 3.1
Ask a Rails expert : What can persuade you to hire Junior Ruby devs with significant PHP experience?
Ask a Rails expert : What industry value does the Ruby or Rails Certification currently have?
Ask a Rails expert : Louis Vuitton Damier Azur Canvas specially sale ( www.salecheaplouisvuitton.com )
Ask a Rails expert : ·How to check errors/puts statements from ruby files which are under cronob
Ask a Rails expert : Louis Vuitton cheap Soft Sided Luggagespecial offer( www.salecheaplouisvuitton.com )