3 ms·
> I always thought it was a bit crazy to let the client control the computational complexity of a query (to a certain degree) as it makes query optimization rea
by jacques_chester 7y ago
> I always thought it was a bit crazy to let the client control the computational complexity of a query (to a certain degree) as it makes query optimization really difficult.
I like the arguments in favour of GraphQL. I think that what's missing is the ability to set resource limits on queries or users. That's relatively common in relational databases. I saw it used by Oracle DBAs on a regular basis, I've seen it done in Greenplum.
Makes me wonder if Hasura would run on Greenplum, actually. Then you would essentially put backpressure on the client to send less intensive queries.
Disclosure: I work for Pivotal, which sponsors and sells Greenplum.
- licyeus 7y agoGithub's GraphQL API calculates a "rate limit score" based on query complexity and allocates a max points-per-hour [1]. Similarly, Postgraphile (which I'm more familiar with than Hasura) allows setting either a max query cost or a max query depth [2]. I haven't had to use either, as I don't provide a public GraphQL API (and can just whitelist the queries I intend my clients to run), but there are ways to limit query complexity. 1 - https://developer.github.com/v4/guides/resource-limitations/ https://developer.github.com/v4/guides/resource-limitations/ 2 - https://www.graphile.org/postgraphile/production/#limiting-graphql-query-depth https://www.graphile.org/postgraphile/production/#limiting-g...