Table and Query Classes good or unnecessary?
On Mon, Mar 12, 2018 at 9:43 PM, Bastiaan Olij <email@example.com>
> 2) The middle-tier, one of more (identical) servers that generally sit
> next to your database server. This provides you with the interface to
> the outside world, instead of having CRUD actions on tables with freedom
> for users to do both intended and unintentional things, you now have a
> carefully crafted API to the outside world. The new hot is RESTFUL which
> is an http based protocol.
The new hot is GraphQL actually. We’ve already had to deal with some of the
outlines in our REST API. The quick and dirty implementation is to let the
framework you’re using generate endpoints that correspond to the various
tables in your system. That’s great in theory but in practice, we don’t
want to make 20 round trips to the server to fetch a bunch of data from
lookup tables and the data so we needed to think more carefully about
endpoint design. We no longer have a one-to-one mapping between endpoints
and tables. Some of the endpoints are more like database views in that they
return data from various tables. The implementation is opaque to the
frontend. It doesn’t care if it was done using stored procedures or built
by the Node.js middle tier. Using GraphQL may have helped simplify our
implementation. I’m seeing GraphQL wrappers around REST. That’s an
acknowledgement that REST has flaws and it’s not going away anytime soon.