This is a common misunderstanding and I think a big reason why people are reluctant to try this type of architecture. The idea here is not to couple client code to the database structure. You should expose schemas that contain views on top of the basic schema, which provides good encapsulation and prvents both of the issues you bring up. (This was common 25 years ago, when server-side code often amounted to a db schema containing stored procedures.)
Re:PostgREST
by konschubert on Sunday November 03, 2019 @04:51PM
(#21436912)
That’s a step in the right direction but I’m not sure if it really solves the problem.
But as I said, there are trade offs. I didn’t say it’s always a bad idea.
I agree there are always trade-offs, but at least as far as "losing a lot of he database performance" and "doing complex joins on your front end", I don't think there is anything in the PostgREST approach that would push in that direction. For more background on the performance part (Oracle-specific but most of it carries over) check out http://www.prohuddle.com/webinars/ToonKoppelaars/ThickDB.php
Re:PostgREST
by steve-chavez on Sunday November 10, 2019 @05:29PM
(#21500603)
It's amazing that at PostgREST we have reached the same pattern for exposing the API(views + sps).
Thanks a lot for sharing.
Re:PostgREST
by ruslan_talpa on Sunday November 03, 2019 @04:30PM
(#21436753)
when it comes to these tools, all your statements are wrong, give them 5 minutes and check our their capabilities (there is no coupling and joins in frontend) :)
Additionally, if you are using a lossy intermediate query representation instead of plain SQL, you will end up losing a lot of he database performance and find yourself doing complex joins on your front end.