开发者

Rails 2.1 and Rails 2.3 sharing the same database

We have an admin application used to manage member data and it was built in 2.1, has been running for about a year. Now that all inputs and data massage is done, our client wants to start building member site, members will have access to data the administrators have been inputting.

Here's the question, should we start a new Rails app hooked to the same admin database or should we create a new Rails app in different db with master-slave settings? The good thing about creating a new Rails app is obviously taking advantage of the new version, which we like. Or ..maybe j开发者_如何学Pythonust build the member site in the same admin app?

THanks,


Why don't you want to build the member site in the same admin app? Too much legacy?

You can use the same database but the problem is you will have to enforce any conditions you have in your models directly in your database (mandatory fields, model relationship and so on).

And I can see a lot of duplication code happening between the two apps. At least for the models. Which is really wrong :(

I don't recommend making two separate applications but It is hard to answer without looking at your app and without knowing more details.


Or build a new app using a copy of the existing database?


There's no reason the two applications cannot share the same database.

However, there's probably a number of reasons why they shouldn't. But, the only way you're going to figure those out are by going through the changelog of ActiveRecord's database adaptors.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜