3 ms·
I've had this thought that almost 90% of rest APIs are essentially crud that map external API to internal storage layer. With a bit of auth and validation on to
by aleksiy123 3y ago
I've had this thought that almost 90% of rest APIs are essentially crud that map external API to internal storage layer. With a bit of auth and validation on top.
Kinda thinking a lot of rest APIs could just be SQL logic.
Postgrest is pretty much like that but I wonder if you could build a more general tool. SQL + protobufs or SQL + OpenAPI schema.
- adhamsalama 3y agoSupabase?
- aleksiy123 3y agoYeah supabase is similar. But I was more thinking of allowing people to choose any db and be able to expose a rest API on top of that. Postgres, bigquery, supabase whatever. So you can quickly deploy a public facing rest API on views from that data.
- paulddraper 3y agoPostgraphile
- aleksiy123 3y agoYeah postgraphile looks cool too. But I was more thinking any database. And you still get to define/control a public REST interface.
- jd3 3y agoWe are modernizing and migrating a codebase from the 90s that was used for fec filing at the federal + state level and a majority of their business logic was expressed and written as stored procedures in mySQL.
- aleksiy123 3y agoYeah, and in general the advice is to not do that. However I had more of a slightly diff idea. More like instead of having aweb server + orm. You just write SQL for an endpoint which maps the storage data to public response. Essentially what the ORM was doing. And if the server is just managing connection and calling then endpoint query. Then packing the data to JSON response. It can just be shared/generic.
- aleksiy123 3y agoAs a reply to myself I think https://www.tinybird.co/ https://www.tinybird.co/ is pretty close to this. Except I'm not sure if they are read only or not.