Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

We are planning to create a web application in rails. We came up with two different ideas for the structure:

enter image description here

Hence we do not have a lot of experience with rails applications we are not sure which of the two options above would be the better choice. What is best practice in rails, building larger scale applications?

The pro's we see for option 1: + API is well maintained, because the main application is accessing the API as well as any other application. The API will be built at the same time as the main application is built.

The pro's we see for option 2: + Speed, due to less cross application requests + API only supports methods which we want to provide to external applications

In a later stage, we assume to have another authentication/authorization layer for the API, which handles the allowed methods for each application:

enter image description here

Which Option should we go for and why? Have you made any bad experience with either of those two structures?

Thank you very much for answers!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.