Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Extracting a model and making available as a service

ActiveRecord REST API

  • Please log in to reply
No replies to this topic

#1 bardia_1

bardia_1

    Passenger

  • Members
  • 5 posts

Posted 08 May 2014 - 06:38 AM

I have an application (application1) . This application has grown, and there's going to be more apps that will consume the user information.

 

I want to extract the user model, and have it serve the data on a separate server (ie. Services API) to fictitious app2, app3, app4, etc.

 

 

Restriction:

Applicaiton1 - this has to stay at is at the moment in the way it is, and reference the model locally.

 

Services API application will dispense information to app2, app3, app4 etc... and a down the line we can have applicaiton1 consume data from Services API for the user.

 

What's the best way of attaining this? 

 

My current research has three solutions

1. Use git submodule in Services API to reference the Application1 users model

2. Use symlinks

3. Use federated tables (mysql supports this, sql server supports this (slow), postgres 9.3 supports this)

4. In the Services API database.yml directly reference the Application 1 database.

 

I've had success with solution 4 in the past, what's the forum communities input?

 

 

Please ask me questions so I can further clarify.

 

 

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users