Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ruslan_talpa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
ruslan_talpa
7y ago
If you think RDBMs can't horizontally scale you have not kept up with the developments :) Look into https://docs.citusdata.com/en/v8.3/get_started/what_is_citus...
62.
▲
by
ruslan_talpa
7y ago
not exactly what i meant. it's true that it's not a polished workflow to debug stored procedures because you you have to jump from your editor to pgadmin but i don't think this is such a big deal for two reasons. - postgrest
63.
▲
by
ruslan_talpa
7y ago
it is hard to read if you don't have some knowledge of haskell indeed and the comments part is true but it's not any harder then folowing other codebases if you don't know the particular language so i don't think this is
64.
▲
by
ruslan_talpa
7y ago
why would you "expect" that if you don't know about it?
65.
▲
by
ruslan_talpa
7y ago
you are confusing postgrest with postgraphile :)
66.
▲
by
ruslan_talpa
7y ago
How do you easely piece together a (poerfull) rest api just by having the definitions of the tables in the database? Very very old videos but you can get the core idea https://begriffs.com/posts/2014-12-30-intro-to-post
67.
▲
by
ruslan_talpa
7y ago
Sure you can use it as two tier if that does the job but it does not mean you are forced to, you can very well have logic in the proxy layer and then have logic below the db layer (workers reacting to database changes). If i apply the same
68.
▲
by
ruslan_talpa
7y ago
You can’t just throw complexity at ppl from the first lines of documentation especially when talkin about new ideas
69.
▲
by
ruslan_talpa
7y ago
Why do you think this is a two tier system? Even here [1] i count 4 places to put logic into besides frontend 1. https://github.com/subzerocloud/postgrest-starter-kit/blob/m...
70.
▲
by
ruslan_talpa
7y ago
Have you looked into postgrest's "select" parameter? Your comment about the "scope" of the query applies here too. Also GraphQL is a protocol and you can't really say it will have poor performance, it all depen
71.
▲
by
ruslan_talpa
7y ago
you could use Auth0 [1] to authenticate your clients using all the identity providers (FB/GOOGLE...etc) and then just have the api clients use that JWT token when talking to postgrest If however you do only want to authenticate the use
72.
▲
by
ruslan_talpa
7y ago
actually .... :) Postgrest has the same "capabilities" as GraphQL so if one is not carefull and jsut (naively) exposes tables with millions of rows with just postgrest (and no propper indexes) it can get bad fast since the client
73.
▲
by
ruslan_talpa
7y ago
Let's start with the fact that most of the data centric apis have a 80/20 split on read write, so there is virtually not SP in 80% of your api, so no need to debug 80% of the code :) so you "might" need stored procedures
74.
▲
by
ruslan_talpa
7y ago
It's not doubling on the ORM part, it's not a orm replacement, it's a replacement for the entire api layer (that uses orm internally). I agree with the other point, this is meant to be used when your client can not ahve direc
75.
▲
by
ruslan_talpa
7y ago
The row level security is a feature of the database (postgresql), those rules are written and enforced by the database, they have nothing to do with PostgREST and how it connects to the database
76.
▲
by
ruslan_talpa
7y ago
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) :)
77.
▲
by
ruslan_talpa
7y ago
Thanks for this. People are always skeptical of this approach, not because the tried it and failed (or even thought 5 minutes about it) but because they read some blogpost somewhere. Not to say though that this solves everything, there are
78.
▲
by
ruslan_talpa
7y ago
It's true that a tool developed by 1-2 ppl recently is not a convenint as the tools developed by armies of developers over decades :) but, when it comes to PostgREST way of building apis, the debugging does not have the same meaning as
79.
▲
by
ruslan_talpa
7y ago
That is all true but postgrest goes a step further then Dereks approach (where you need to basically write a lot of stored procedures) and gives the fronend access to safe subset of SQL, so that frontend is not strictly limited to the capab
80.
▲
by
ruslan_talpa
7y ago
between postgrest/postgraphile/hasura there are 30k stars, have all those ppl fallend for this "dumb" idea :)? You say "expose db" and imply that one would directly give access to the core tables and in this wa
81.
▲
by
ruslan_talpa
7y ago
reuse code where? In the db, why couldn't you? Or do you mean to reuse the logic in the db in some other place? By this logic one can say "ruby is bad becasue i can't reuse logic i wrote for the backend in my frontend SPA&quo
82.
▲
by
ruslan_talpa
7y ago
Very well said (I'll have to remember this way of explaining it). IMO in most projects, the intermediate layers never do anything interesting so that's why postgrest (as a proxy) is a good fit
83.
▲
by
ruslan_talpa
7y ago
I understand the problem you are describing, i would say that is a wrong type of view to create, if one plans to write filters on top of that view then it should be written so the filters can be inlined in the view (which would basically gi
84.
▲
by
ruslan_talpa
7y ago
https://github.com/subzerocloud/subzero-cli your code is in files (so git ...) and you edit files adn save them and the new version is loaded to the database and you can make the new api call and see it in action
85.
▲
by
ruslan_talpa
7y ago
I guess each person's oppinion is colored by personal past experiences, i too can come up with stories of how backend apis with 10s of thousands of lines got reduced to a handfull of views and stored procedures. But it's true this
86.
▲
by
ruslan_talpa
7y ago
you can write your stored procedures in JS of Python if you don't like plpgsql that much :)
87.
▲
by
ruslan_talpa
7y ago
what do datatypes have to do with this. For both PostgREST and any other api layer the situation is the same. The data sits in the db/tabes (so both parties are restricted to the types available in pg) and on the other end you need to
88.
▲
by
ruslan_talpa
7y ago
Becasue i know the codebase maybe :)? How does the tag line say "postgrest is a ORM" and how am i interpreting it in the exact oposite way?
89.
▲
by
ruslan_talpa
7y ago
a view is nothing but a query, so if the view is "killing" the performace for you, running the same query from the client will not change anything, the porformance will get "killed" in the exact same way.
90.
▲
by
ruslan_talpa
7y ago
postgrest is not (and does not use) a ORM Postgrest is more like a compiler, it takes one language as input (REST) and outputs another language (SQL) as output. It has 0 relation to the ORM concept
More ›