Subterfuge-Revived / Remake-Backend

Server side validation and API
Creative Commons Zero v1.0 Universal
10 stars 1 forks source link

Consider gRPC #41

Open QuinnBast opened 4 years ago

QuinnBast commented 4 years ago

Enhancement Description

GRPC allows defining static data models that get propogated across language libraries. By using gRPC the Core & php libraries can easily share their model data structures through the use of gRPC's php and C# libraries.

We currently use REST which, while it is a good implementation, doesn't provide data consistency between the server and client. Anytime the server is updated, the client also needs to update itself to manage the different JSON syntax. Additionally, When new endpoints or models are added, additional C# classes and models need to be created to be able to ingest these endpoints.

By using gRPC a network interface is provided and pre-defined response classes are configured through the gRPC models. gRPC also supports versioning and updates to models won't break previous versions of the interface.

Solution

This is not a hard requirement, just a suggestion but I think it can provide some realisable benefits. gRPC php

I quite like gRPC at work because its a "set and forget" model. You create the data model once, then generate the PHP/C# generated files and then all of your other clients have pre-defined data models and interfaces that they can easily take advantage of.

griendt commented 4 years ago

Conceptually, this is brilliant. But we will have to consider the fact that sometimes, not all fields on one side is relevant (or even desired) on the other side. Obviously passwords of users are encrypted in our database (and protected against rainbow attacks), but, say, e-mail addresses are not. And I don't think it is desirable for the client to know other people's e-mail addresses.

So while I love the idea in principle, we'd have to figure out a way to make sure we won't raise any security issues.