views:

30

answers:

1

I've got this medium-sized app that is starting to get too complex. I'm considering splitting it in two. But I'm uncertain about how would I share information between those.

I've been able to make two big groups of models; One group deals with "pictures" and the other one deals with "sales data".

Some utility models, such as the authentication/authorization related ones, will have to be copied over, I guess. But let's concentrate on the two Big Groups.

The two data sets are maintanied by different people, so they would split quite naturally.

The only place the two groups "overlap" are a couple reports, that pull data from both "pictures" and "sales data". The information in both cases resembles an array of hashes, with different depths, pointing to calculus (around 60 numbers per system).

That's pretty much the only thing holding the split; I'm not sure about what would be the best way to share information between both apps.

I'd appreciate any pointers to what would be the best way to accomplish this. Should I try to use the same database for both apps? Should I use some kind of web service instead?

+1  A: 

The simple solution would be getting both the applications to use the same database. The problem of doing so would be that you'd get some code duplication on the models on the overlap. You could of course fix it with a git submodule or custom gem... An interesting to look into regarding this would be rails engines.

A different solution would be that 1 application has the data and expose an RESTful API and the other pulls from it. But then you need to decide which one gets to "manage" the reports.

It's a pretty complex decision and I can't help you make it without all the data, but I hope this has been helpful ^^

marcgg
kindof what I thought. I was hoping for a rails plugin or something similar, but I think you have described the two options rather well. Unless anyone else suggests a better solution, the answer is yours.
egarcia
Since no one else has answered, yours is the most correct one! thanks!
egarcia