Ruby on Rails: how to design a SaaS infrastructure?

↘锁芯ラ 提交于 2019-12-09 18:08:18

问题


I'm building a Rails 3 application that I plan on provided as a subscription-based SaaS (Software as a Service) product. Basically, I want users to be able to hit my "Sign up" page, create a new account, and immediately start using the software.

A good example of what I'm trying to accomplish is: http://www.getharvest.com/

Here's what I need to happen when someone signs up:

  1. A MySQL database for them is generated on the db server
  2. A sub-domain is created (e.g., companyx.awesomeapp.com)
  3. The Rails app should know the appropriate database to connect to based on the sub-domain

Are there any good guides out there for setting this stuff up? Even better, are there services that you can purchase to automate this type of thing? Ideally, I'd like to just worry about writing my Rails app and then be able to plop it atop some awesome Rails SaaS infrastructure.

(Also, I need a way to bill them monthly, but I think that's a separate question/problem.)


回答1:


Heroku would let you get up and running quickly. You can manage the infrastructure using the heroku gem. Here is the documentation to the client which should allow you to manage heroku applications remotely. Using heroku would allow you to scale applications on an individual level and let you focus on the code of the application instead of the hardware.



来源:https://stackoverflow.com/questions/6961677/ruby-on-rails-how-to-design-a-saas-infrastructure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!