Live data from Hacker News

A Poor Man's API

blog.frankel.ch

21–30 of 127 posts

Re: A Poor Man's API

#21
post #11

Check out this simple, easy API replacement: just set up Docker, APISIX, Grafana, Prometheus, etc. Does anyone else miss the old days of just editing your site's code and adding new columns to your MYSQL database while people were surfing your website? That was fun. Tip: Another way to turn your DB into an API is to just connect to it and then write SQL queries.

Absolutely. It is shameful how much stuff needs to be run before you can even get started.

Re: A Poor Man's API

#22
Ehh this seems more annoying than just writing an MVP in (your language of choice) given you already have the expertise.

Re: A Poor Man's API

#23
post #22

Ehh this seems more annoying than just writing an MVP in (your language of choice) given you already have the expertise.

Many projects grow to the point that the limitations of writing everything in views and stored procedures becomes more painful than writing the CRUD code in Python, Node, Ruby, PHP, or whatever.

Personally, I’d give a shout for https://api-platform.com/.

Re: A Poor Man's API

#24

Not to be mean, but from my reading this needs Heroku free tier which no longer exists? I am very sorry if I got that wrong.

Supabase has a free tier with all this included, plus more. It's the best install of postgres I've seen and I'm obsessed with how it makes triggers, auth, etc., all included.

Did a user group presentation on Supabase, no one in the audience had ever heard of it. I came away quite impressed. Plan on building a complex API with it soon. If I was currently employed as a backend developer I'd be worried.

Re: A Poor Man's API

#25
post #18
post #17

> Creating a full-fledged API [...]. You need to think about [...] the REST principles I can assure you you don't need to do that. And most people don't. It's perfectly possible to create a useful API without adhering to the REST principles. [Edit, having read the rest of the article]: Case in point, this very PostgREST tool promoted in the article appears very useful, while not thinking about the REST principles.

If you're talking about HATEOAS (which many zealots equate one to one with REST) you may be pleased to know there is no reference to it whatsoever in this article.

> zealots

REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, hypermedia as the engine of application state.

Re: A Poor Man's API

#26
post #16
post #12

Earlier quoted context omitted.

Grafana and Prometheus aren't necessary, and Docker is at this point pretty close to a Linux platform feature. APISIX is a reasonable complaint --- the "poor man's API" is "using a big open source project that provides generic APIs", sure, that's not all that clever.

The goal was simplicity and cheapness, not being clever. Using a simple, existing tool is better than unnecessary complication, no?

I've never looked an an Apache project, certainly not APISIX, and thought "wow, so simple".

Re: A Poor Man's API

#27

Not to be mean, but from my reading this needs Heroku free tier which no longer exists? I am very sorry if I got that wrong.

NKOTB: https://neon.tech/ Free Tier includes: compute up to 1 vCPU / 256 MB storage up to 10 GiB 3 projects per user

Neon is fresh out of private beta (or should be soon). I can't wait to play with it. However they're all about Hasura lately rather than PostgREST, which this article talks about.

Nikita, their CEO, was a guest on the Changelog[0] podcast a month or so ago. Well worth a listen, great episode.

[0] https://changelog.com/podcast/510

Re: A Poor Man's API

#28
post #11

Check out this simple, easy API replacement: just set up Docker, APISIX, Grafana, Prometheus, etc. Does anyone else miss the old days of just editing your site's code and adding new columns to your MYSQL database while people were surfing your website? That was fun. Tip: Another way to turn your DB into an API is to just connect to it and then write SQL queries.

Absolutely. It is shameful how much stuff needs to be run before you can even get started.

You still can do it, the main feature is: it just works. You don't have to follow the hype. One problem could be that new devs never experience the simplicity of such a setup, but that is not your problem.

Re: A Poor Man's API

#29
post #11

Check out this simple, easy API replacement: just set up Docker, APISIX, Grafana, Prometheus, etc. Does anyone else miss the old days of just editing your site's code and adding new columns to your MYSQL database while people were surfing your website? That was fun. Tip: Another way to turn your DB into an API is to just connect to it and then write SQL queries.

I miss aspects of those days, because I made a good bit of money from people who used MyISAM because "it's more performant" (or just because it was the default, yes, I'm dating myself here), and then corrupted their data because MyISAM didn't enforce constraints.

Other than the easy money, nah, don't miss the old days that much.

Having to use Reflector to decompile a core .NET library to figure out wtf it was doing because MSDN was inadequate, and the source was very much not open.

PHP 4 code bases that heavily leaned on dangerous globals.

J2EE.

Ah, the "good" ol days.

Re: A Poor Man's API

#30
post #18
post #17

> Creating a full-fledged API [...]. You need to think about [...] the REST principles I can assure you you don't need to do that. And most people don't. It's perfectly possible to create a useful API without adhering to the REST principles. [Edit, having read the rest of the article]: Case in point, this very PostgREST tool promoted in the article appears very useful, while not thinking about the REST principles.

If you're talking about HATEOAS (which many zealots equate one to one with REST) you may be pleased to know there is no reference to it whatsoever in this article.

Or is it the other way around? I seem to remember that Roy Fielding did actually mean HATEOAS when saying REST, that REST isn't only CRUD but a discoverable and self-describing API.

EDIT: And the corollary of above is that most people when saying REST actually mean HTTP with correct method use.

If not, then is there a good source on what you mean by REST and HATEOAS?

Post reply on HN