Live data from Hacker News

PostgREST – REST API from any PostgreSQL database

github.com

41–50 of 210 posts

Re: PostgREST – REST API from any PostgreSQL database

#41
post #33
post #30

Earlier quoted context omitted.

You implement any custom logic in PostgreSQL mechanisms (permissions, triggers, constraints, views, stored procedures etc).

...and be locked in for life, joy.

> ...and be locked in for life, joy.

"The argument that you don't want to write any code that locks you to a database is some stunning lack of awareness, as you decide to lock yourself into the tsunami of unpredictability that is web frameworks to ward off the evil of being locked into a 20 year database product built on some pretty sound theoretical foundations."

https://news.ycombinator.com/item?id=9928321

Re: PostgREST – REST API from any PostgreSQL database

#43
post #18
post #16

Earlier quoted context omitted.

Most people, really?

Yes. HN is a bubble. There are ~700 PHP questions on SO a day and ~150 node.js. This is just one pair of numbers, you can mine your own whatever you like but you'll realize there are massive amounts of "web developers" with a ... low amount knowledge.

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

Re: PostgREST – REST API from any PostgreSQL database

#44
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…

For one, stored procedures are hard to test, debug, maintain and check into source control.

But don't let that get in your way of ignorantly generalising about web developers.

Re: PostgREST – REST API from any PostgreSQL database

#45
post #32

I'm sorry but why would I go through HTTP to query data? Why can't I just hit the database directly without the overhead of HTTP? Does a cleaner and being more standards-compliant worth the overhead of passing through HTTP? And what happens when you start applying complex business rules that needs to scale? So many questions about this approach...

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

Re: PostgREST – REST API from any PostgreSQL database

#46
post #33

Earlier quoted context omitted.

...and be locked in for life, joy.

Is it a common circumstance to completely switch your data layer without having a massive rewrite of your application? Do people frequently flip from pg to Oracle, or from SQL Server to MongoDB, and it was super-easy because that layer was abstracted?

[deleted]

Re: PostgREST – REST API from any PostgreSQL database

#47
post #43
post #18

Earlier quoted context omitted.

Yes. HN is a bubble. There are ~700 PHP questions on SO a day and ~150 node.js. This is just one pair of numbers, you can mine your own whatever you like but you'll realize there are massive amounts of "web developers" with a ... low amount knowledge.

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

The latest version of WordPress is still compatible with PHP 5.2.4 and above, so anyone who builds a WordPress site is effectively shipping a PHP 5.2 app.

Re: PostgREST – REST API from any PostgreSQL database

#48
post #44
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…

For one, stored procedures are hard to test, debug, maintain and check into source control. But don't let that get in your way of ignorantly generalising about web developers.

"hard to test, debug, maintain and check into source control."

Why? I have never had problem with any of these. SPs is just imperative code like any other imperative code.

Re: PostgREST – REST API from any PostgreSQL database

#49
post #44
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…

For one, stored procedures are hard to test, debug, maintain and check into source control. But don't let that get in your way of ignorantly generalising about web developers.

Stored procedures may be all of those things, but they don't have to - it's just that most of the time, developers don't really care, so they have fancy versioning, deployment and continuous integration for all their code, except for stored procedures.

Here is interesting talk about database migrations and stored procedures and unit tests: http://www.pgcon.org/2013/schedule/events/615.en.html

Also, DB procedures are not easy to "debug" in the traditional way, but SQL client is basically the first REPL every programmer becomes familiar with. You can easily step stored procedure by running it's commands one by one, unless it's fancy Oracle forall loop with cursor or something (and the cursor select can still be selected as normal).

Also, databases tend to have more strong data types than programming languages in general so putting constraints in DB means, that bad data are not savable in the system.

Re: PostgREST – REST API from any PostgreSQL database

#50
post #33

Earlier quoted context omitted.

...and be locked in for life, joy.

Is it a common circumstance to completely switch your data layer without having a massive rewrite of your application? Do people frequently flip from pg to Oracle, or from SQL Server to MongoDB, and it was super-easy because that layer was abstracted?

Not frequently, but yes. Was forced to move from Oracle to Postgres, not that I mind Postgres. Very little software changes were required to get up and running. If everything was in views or stored procedures the change would have taken months instead of weeks.
Post reply on HN