What does HackerNews think of postgrest-starter-kit?

Starter Kit and tooling for authoring REST API backends with PostgREST

Language: PLpgSQL

#21 in API
#61 in Docker
#50 in PostgreSQL
#11 in REST API
The recommended way to use Postgrest is to put a layer of views and optionally stored functions on top of your schema to decouple it from your API. Take a look at this Postgrest starter kit[1] which uses a separate API schema for this purpose.

[1] https://github.com/subzerocloud/postgrest-starter-kit

The things you said are a pain (or can’t be done) here is how you do it https://github.com/subzerocloud/postgrest-starter-kit

Specifically, testing the sql side with sql (pgtap) and having your sql code in files that get autoloaded to your dev db when saved. Migrations are autogenerated* with apgdiff and managed with sqitch. The process has it’s rough edges but it makes developing with this kind of stack much easier

* you still have to review the generated migration file and make small adjustments but it allows you to work with many entities at a time in your schema without having to remember to reflect the change in a specific migration file

actually .... :) Postgrest has the same "capabilities" as GraphQL so if one is not carefull and jsut (naively) exposes tables with millions of rows with just postgrest (and no propper indexes) it can get bad fast since the client could create queries that join and return a lot of data.

That's why one does not deploy postgrest alone but use it in a setting like this https://github.com/subzerocloud/postgrest-starter-kit

where you at the proxy level can say things like "return 400 if the client did not provide at least 2 filters for the table" or "allow filtering on column a and b because they have indexes but not on c"

But again, those are things to consider when you have datasets exceding hundreds of K or millions, you don't need to care about this when you have tables with 10s of Ks

This is a solved problem https://github.com/subzerocloud/postgrest-starter-kit

It’just the tools you linked didnt prioritize the development workflow from the point of view od a backend developer (code in files, git, tests, migrations) but from the frontend developer perspective (ui to create tables)

Authorization is explained in the docs (done by PostgreSQL). All the bits together here https://github.com/subzerocloud/postgrest-starter-kit
It's a lib working at a higher level so things like n+1 are left to be solved by the user since the implementation details depend very much on the underlying data storage.

If you use PostgreSQL however, i solve that problem :) https://subzero.cloud (GraphQL & REST api for your database) It's still in private beta but you can get a sense of how things are put together by looking a this OS project (just REST) https://github.com/subzerocloud/postgrest-starter-kit

you can if you really want to, but you are not supposed to. this tool gives you a way to talk to your database, not other systems. to talk to 3rd party systems you use other components in the stack (openresty/rabbitmq) https://github.com/subzerocloud/postgrest-starter-kit
This tool enables a decoupled architecture. A simple example is sending emails when a user signs up. Instead of having explicit code in your signup function that does the work (and slows down your response), you just have to worry about inserting the row into the database. After this, a database trigger will generate an event which gets sent to RabbitMQ. From there, you can have multiple consumers reacting to that event (email, sms, log, cache). Those consumers tend to be very short, self contained scripts.

A more complex example is if you pair pg-amqp-bridge and the Web STOMP plugin for RabbitMQ, you can enable flexible and robust real time updates with almost zero code for your frontend.

The larger goal is to enable the development of backends around PostgREST [1] / subZero [2] philosophy. Check out the PostgREST Starter Kit [3] to see how pg-amqp-bridge fits in a larger project.

Similar work (for kafka) is bottledwater-pg [4] which has a nice blog post [5] explaining the benefits of the architecture

[1] https://github.com/begriffs/postgrest [2] https://subzero.cloud [3] https://github.com/subzerocloud/postgrest-starter-kit [4] https://github.com/confluentinc/bottledwater-pg [5] https://www.confluent.io/blog/bottled-water-real-time-integr...