We are planning to create a web application in rails. We came up with two different ideas for the structure:
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:
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!