Package Data | |
---|---|
Maintainer Username: | danmrichards |
Maintainer Contact: | dan.richards@lush.co.uk (Dan Richards) |
Package Create Date: | 2017-04-11 |
Package Last Update: | 2017-11-17 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-14 15:00:10 |
Package Statistics | |
---|---|
Total Downloads: | 547 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 23 |
Total Watchers: | 24 |
Total Forks: | 6 |
Total Open Issues: | 1 |
A Lumen package to provide a familiar model paradigm for distributed data.
This package provides a model system, similar to Eloquent, but with the key focus on distributed data. Each model class is bound to a remote microservice with an expected RESTful API. This allows developers to create service aggregators which can manipulate data, via models, just as easily as if the data was in a local database.
To allow this to work the package is quite opinionated on the request/response data in the remote services. This data should always conform to the following standard:
https://github.com/LUSHDigital/microservice-core/blob/master/spec/swagger.yaml
This package is intended to operate within a Kubernetes cluster whereby service discovery is handled by DNS names.
The package also handles relationships between remote models via the use of gRPC. As well as the microservices existing to power the remote models, it is also expected that a gRPC application will be available to manage the relationships. This gRPC application is based upon this protocol buffer.
See the Configuration documentation for information on DNS and ports.
Install the package as normal:
$ composer require lushdigital/microservice-remote-models
Register the service provider with Lumen in the bootstrap/app.php file:
$app->register(LushDigital\MicroServiceRemoteModels\RemoteModelServiceProvider::class);
The package requires that the following changes are made to the Lumen config in bootstrap/app.php
<?php
// Uncomment the line below to enable Facade support.
$app->withFacades();
// Uncomment the line below to enable Eloquent ORM support.
$app->withEloquent();
// Add the line below to load database config. This is required for caching to work.
$app->configure('database');