开发者

Setup an application from a parent application

I am working on an application which acts as a setup box for other child applications. I want to set up child applications from one central parent application. Set up includes database setup (db:create and db:migrate), subdomain set up etc for child apps.

This is going to work like this: a Subscriber will subscribe many applications. On subscription the application will be configured to work on subscribers provided subdomain (on my site). Every instance of a subscribed application will have its own database. So I need to set up database for each subscriber, and domain n开发者_如何学Pythoname too.

Currently I am creating database based on child application subdomain, using ActiveRecord::Base.connection.execute.

After creation of the database I want to load the schema of the child app to the database created. For this I had posted a question here schema.sql not creating even after setting schema_format = :sql

Is there any good efficient method/approach that will help me?

Also I am a bit confused about subdomaining how its gonna be work?

Any help/thought appreciated...

Thanks,

Pravin


Since there is no real need for a separate database for each user and for each 'app', you may want to check out a term called multi tenant.

Also, subdomains can be handled in rails 3 and use something called Devise for User authentication. Github has a rails 3 sudomain devise authentication fork to get you started.

Until you really see a need for all these databases, keep it simple. One database per application, and connect to each application via Active Resource.

Be warned, that what you are undertaking can confuse even a hardened app builder, so i hope your experience begets that of which your current Stackoverflow rate is at.

All the best.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜