Question

I have a large rails application with 3 separate 'components'.

One is a mostly static WWW site, one is a shopping cart based on Spree, and one is a reward-program based on Instagram's API.

Currently they are all one giant Rails 4.0 application. As this app has grown over time, I have it harder to make distinctions between components. I want to modularize the app to keep these 3 components separate.

Is there a preferred way to do this "SOA" sort of architecture? or would it be better to turn each 'component' of the app into their own mountable engine? Or is there an even better strategy?

I have been looking at Spree's core, and how they have each component as an engine, and load them in the top level, and I'm thinking this may be the best route.

Was it helpful?

Solution

I don't have any experience with Ruby or Rails, but based on my experience you will need to ask/answer the below question and then decide how you want to proceed forward.

Who's going to be developing the code base and who'll be maintaining it?

If it's just you who's wearing all the hats, you may not want to have the overhead of implementing SOA (web-services to be specific). That said, you should definitely have a 'Contract' between each of these components or modules (however you refer to them). That way your modules/components can evolve independently and changes made to one to make the logic better doesn't necessarily mandate changes to the other components.

If it's you and a couple of other developers, I'd still say that you may not want to take the WS route yet.

If it's different teams that are developing and maintaining these components, then you are taking about an application at enterprise level and then you will start seeing the benefits of SOA (based on WS).

Cheers, K

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top