lundi 7 mars 2016

Migrating Laravel from using a Database to using a RESTful API

The company I'm working for is currently using Laravel5 for the web application. And we're trying to move as much of this as possible into the AWS cloud.

Right now, its just a basic Laravel5 application with a MySQL back end, but the plan is to migrate to MongoDB (or some other NoSQL DB), and interact with said database via the API Gateway in AWS, (Including the primary Laravel5 web application going through the API)

To keep the website running, this is the route I think may work best:

  1. Create the API resources to interact with the existing MySQL database
  2. Change the models in the Laravel web application from using the existing Eloquent models, to using the API gateway
  3. Create the NoSQL database and collections, and the models to interact with said collections
  4. Create the new API Gateway resources to interact with the NoSQL models
  5. Switch the Laravel model API Access points to the new API resources

So I guess my main question is, is it possible to have Laravel5 models interact with an API via PHP? Obviously we couldnt use Eloquent, but im just wondering how efficient it would be to have the main application using a RESTful API.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire