9 ms·
With a REST layer like https://github.com/begriffs/postgrest https://github.com/begriffs/postgrest you don't need any extra application server layer to serve yo
by lugus35 11y ago
With a REST layer like https://github.com/begriffs/postgrest https://github.com/begriffs/postgrest you don't need any extra application server layer to serve your data, securely (RLS). Bye bye Java EE ?
- scardine 11y agoPostgrest has a very clever design. I want to see other tools going this route.
- saosebastiao 11y agoIt would be kinda cool to find a way to stuff a fast HTTP server into Postgres and run it all directly from the Postgres process serving the request.
- dc2447 11y agoThere is an nginx module for this.
- leeoniya 11y agorelevant?: https://en.wikipedia.org/wiki/Jamie_Zawinski#Zawinski.27s_law_of_software_envelopment https://en.wikipedia.org/wiki/Jamie_Zawinski#Zawinski.27s_la...
- nickpeterson 11y agoPeople seem to dislike this because they want separate components in order to 'scale out', but honestly, having the option for most trivial applications would be extremely nice. Even more so when you consider Postgres supports routines written in non-sql programming languages.
- bdcravens 11y agoI looked at Postgrest, and it was a little more opinionated re URLs and associations than I would have preferred.
- brunoqc 11y agoI'm not that familiar with REST. Care to explain what you mean?
- Pxtl 11y agoREST just mean exposing your business object via HTTP verbs. In addition to the normal Get and Post http verbs used by your browser, there's also Delete and Put. Put is effectively equivalent to an Upset command, so with Get, Put, and Delete you've got all the operations to manage an object (create/read/update/delete), with Post for special procedures. Those also obviously correspond to the Insert/update/select/delete SQL operations. So hooking a RESTful interface direct to your db lets JavaScript on the client talk directly to the database via an http server with no business layer in between. It's obviously a nifty workflow for the "JavaScript all the things" developer. That said, I think restfulness is a bit of a fad tied to the popularity of javascript-everything. But it has created a limited, simple standard for http services, so that's nice.
- brunoqc 11y agoThanks but I was referring to what the person meant by saying that something was not like he would have preferred.
- topspin 11y agoPostgrest deviates from some REST URL conventions that REST users are familiar with. As an example, one very common convention gives each item a distinct path with the 'id' (the primary key of some table, typically) as the last path element: /some_path/123. Notice that the 'key' column name is implied and simple (not compound). Postgrest does not adopt this convention. This decision is not arbitrary, however. Postgrest is conceptually a function that computes a REST API for a PostgreSQL database, and tables in a PostgreSQL can (for better or worse) have compound primary keys, which do not map well to a simple URL path. So Postgrest uses a more general URL syntax. The equivalent of the above is: /some_path?id=eq.123. Postgrest represents some novel thinking about the use of certain HTTP verbs as well. A lot of this is discussed in the Postrest introduction video here: http://postgrest.com/ http://postgrest.com/
- reitanqild 11y agoYou just got an accidental downvote as I came back after bookmarking your link. Sorry. Dang/mods: Can we please please get something to avoid accidentally downvoting good stuff on mobile phones?
- saidajigumi 11y agoIt's especially bad on mobile, but desktop can be a problem too. I know I've misclicked a downvote on rare occasion, to my regret.
- danieltillett 11y agoHappens all the time and has been the most requested feature of all time. I like to take the charitable view and say the current design is there to let your ego explain away down votes - i.e. I am only being down voted by accident, not my post is terrible.
- mdellabitta 11y agoThat feature is included with every new account!
- spacemanmatt 11y agoI gotta plug OpenRESTy at this point. It's based on Nginx, and it's really easy to work with. It is my go-to REST solution for PostgreSQL.
- rodionos 11y agoIt's not going to be as easy as you make it sound - getting rid of the application tier. Think of all the goodness that the Spring framework provides, for example. Do you anticipate all the modules will be taken over by a database?