Live data from Hacker News

PostgREST – REST API from any PostgreSQL database

github.com

181–190 of 210 posts

Re: PostgREST – REST API from any PostgreSQL database

#181
post #150

Earlier quoted context omitted.

Resources only map 1-to-1 with database models for trivial applications, so certainly not the future. Still, useful for getting up and running.

Coming from the old world of business IT where "integrate everything with the relational database" is standard procedure, it's certainly not unusual for the database to be a place where abstractions are defined(1), so what you expose via PostgREST may not in fact be a close match for the underlying data model. (1 - In fact with me it's pretty much a matter of policy: any external system should access data via views n…

That's also what postgrest documentation suggests as the way to deploy it.

Re: PostgREST – REST API from any PostgreSQL database

#182
post #150
post #6

Contrary to many other "expose a RDBMS schema as an API" solutions, this one is interesting due to its very close tie-in with postgres. It even uses postgres users for authorization and it relies on the postgres stats collector for caching headers. I also very much liked the idea of using `Range` headers for pagination (which should be out-of-band but rarely is). I'm not convinced that this is the future of web devel…

Resources only map 1-to-1 with database models for trivial applications, so certainly not the future. Still, useful for getting up and running.

What kind of resources do you have that can't be modelled as materialized views and make sense to store in a database?

Re: PostgREST – REST API from any PostgreSQL database

#184
post #45

Earlier quoted context omitted.

Presumably because browsers talk HTTP, but don't talk Postgres' native protocol.

Yeah, this seems great if you want to completely eliminate the middle tier and have a client application talk directly w/ the database. I'm curious why there's an entire query API via query string parameters. Why not just expose a single POST /query endpoint where you can send some SQL?

Squeezing the middle tier as flat as possible is my actual strategy and goal in many distributed environments. That's totally feasible with modern tools.

But sending SQL from the client is dangerous, and in this forum you'll get some interesting looks suggesting that.

Re: PostgREST – REST API from any PostgreSQL database

#185
post #12

This is good work and if I ever did web development, it would be like this. Why people in the web world don't use stored procedures and constraints is a mystery to me. That this approach is seen as novel is in itself fascinating. It's like all those web framework inventors didn't read past chapter 2 of their database manuals. So they wrote a whole pile of code that forces you to add semantics in another language else…

You are speaking from ignorance with the voice of authority. I worked on a rails app that handled a billion requests per day. The problem isn't performance of the web framework, those are easy to load balance and split into C or cache when you need it. The problem is scaling your database, keeping your data secure, and iterating to meet business goals with a growing codebase and infrastructure. A mess of stored proce…

I'm always a little confused that people seem desperate to use the wrong tool, and then blame the tool. If you need to store normalized data and maintain integrety -- you'll end up with the equivalent of an SQL datastore (or, more likely a system that is faster, but subtly broken).

Sure, it's difficult to scale ACID. But if what you need is a way to serialize objects, you'll probably be better off with something like Gemstone/GLASS, a document store or some other kind of object database?

If your problem domain actually fits working with structured data, then using an SQL system makes a lot of sense. The obvious example for "web scale" here is Stackoverflow. Sure their architecture has grown a little since it was 2xIIS+2xSQL Server -- but they got pretty far on just that.

Re: PostgREST – REST API from any PostgreSQL database

#186

Earlier quoted context omitted.

To say that Facebook uses PHP and MySQL is to leave out the truth, honestly. They are a part of the stack, yes, but they aren't what makes the application scale to billions of requests. It would be like saying the local coffee shops website using Wordpress with a MySQL backend is using the same tech as Facebook. It's laughable.

To say that PHP/MySQL is just a "part of Facebook's stack" is laughable. They are the core components of Facebook. Normal people understand that the characteristics of Facebook's architecture is unique to just Facebook. They can get away with sharding/colocating data that nobody else can. The rest of us have a tonne of integrated data that requires complex joins (whether at the application or database layer).

They are edge components of Facebook. Just from a brief interaction with FB recruiters, I learned they use a lot of Vertica in their back-office. Please don't propose that they are using MySQL for their main business when it's only powering app nodes which are just POPs fed by their real (internal) services. Approximately speaking.

Re: PostgREST – REST API from any PostgreSQL database

#187
post #112
post #43

Earlier quoted context omitted.

Thinking most web developers are still shipping PHP 5.3 apps on shared hosts is also a very outdated view.

While I do agree with you, I want to make a distinction between shipping and building an application. IMHO the term "developer" should not be applied to those that can just ship but rather those who can also build. It doesn't matter if they are web, desktop, nor low-systems developer actually Most auto-called web developers are just "web masters"

Now you're just redefining "developer".

No True Scotsman puts sugar on his porridge, and No True Developer just installs WordPress.

On the other hand, even Rails and Django encourage you to use the ORM whenever possible, so even a "developer" who builds apps on a modern framework is unlikely to be familiar with advanced SQL features.

Re: PostgREST – REST API from any PostgreSQL database

#188
post #106

Earlier quoted context omitted.

What does logic have to do with it? I'm just stating what I believe to be a fact: that the majority of web developers in this world never think of PostgreSQL as an option. I don't care whether that's a logical thing for them to think. It's just a fact, whether I like it or not. If you think I'm wrong about the facts, please feel free to open a phone book in any part of the world other than the Bay Area, call up a dec…

So you start off ok here: I'm just stating what I believe to be a fact... But then you move on to say: It's just a fact, whether I like it or not. So which is it? Do you believe it to be a fact, or is it a fact? And if it is, where's your evidence? (I happen to agree with your opinion, but the semantics here bug me.)

Sorry for the loose use of language. Everything that follows the colon after "I believe to be a fact", until the end of that paragraph, is the content of what I believe, including the statememt "It's just a fact." I believe that it's a fact.

Anecdotal evidence: I've interacted with dozens of other people who call themselves web developers over the years, and most of them (outside of Silicon Valley) have never used PostgreSQL, nor any advanced features of SQL in any other RDBMS.

Objective evidence: the large market share of WordPress, Drupal, and other content management systems that don't use any advanced database features; as well as the large market share of frameworks such as Rails, Django, and Laravel that encourage developers to stick with the ORM and not care about advanced database features.

Re: PostgREST – REST API from any PostgreSQL database

#189
post #187
post #112

Earlier quoted context omitted.

While I do agree with you, I want to make a distinction between shipping and building an application. IMHO the term "developer" should not be applied to those that can just ship but rather those who can also build. It doesn't matter if they are web, desktop, nor low-systems developer actually Most auto-called web developers are just "web masters"

Now you're just redefining "developer". No True Scotsman puts sugar on his porridge, and No True Developer just installs WordPress. On the other hand, even Rails and Django encourage you to use the ORM whenever possible, so even a "developer" who builds apps on a modern framework is unlikely to be familiar with advanced SQL features.

For me, if you had to write even a single line of a Turing complete language to a file (so shell scripts yes, but one-time shell commands no) to install WP, that would count as development. Otherwise, it's just installation. Note: I have never installed WP.

Do people really consider ./configure && make && make install and its equivalents to be development now?

Re: PostgREST – REST API from any PostgreSQL database

#190

The comments are unbelievably negative considering the quality and the range of features this offers. This is extremely useful because I won't have to spend time writing out REST api in order to expose the Postgre data. Often a client just wants to access the data with REST api and to write an entire stack just to serve a few doesn't make sense. There's no expectation that this is going to serve a gazillion requests…

Best advice I ever got from any engineer that actually caused me to start completing projects was "complicate as necessary, not as desired..."

can you elaborate what that quote means?
Post reply on HN