I love the motivation behind this effort and benchmarking suite! I think this would be very useful for the community if done in a manner useful to GraphQL authors and not just GraphQL vendors. Especially, I believe it will give the community ideas about different ways to implement a GraphQL backend. Also a fan of your work with GraphQL cost measurement!
With reference to the wiki I have some concerns about this benchmarking approach and am jotting down some thoughts here.
The focus of our benchmark will be a scenario in which data from a legacy database has to be exposed as a read-only GraphQL API with a user-specified GraphQL schema.
Systems that can be used to implement GraphQL servers but that are not designed to support this scenario out of the box can also be tested with the benchmark, for which they have to be extended with an integration component such as a schema delegation layer. In such a case, from the perspective of the benchmark, the combination of the system and the integration component are treat as a black box.
I find this approach extremely confusing because the aim is to test integration with a legacy database of a GraphQL server with a user-defined schema. There are 2 problems I have here:
- Your approach here instead will end up testing the schema delegation layer and not the GraphQL server? Isn't this a flawed approach to testing the efficiency of a GraphQL server's implementation?
- If I was writing a user-defined GraphQL schema, why would that schema expose complex subquerying, filtering, traversal, limit, offset? I would expose exactly the GraphQL schema my apps need. What is the rationale behind putting a schema delegation layer in front of an "out-of-the-box" GraphQL server?
As a personal preference, if I was writing a user-defined schema and building a GraphQL server querying a database I would use an ORM not a GraphQL server, like SQL Alchemy or massive.js or knex.
I find this approach of benchmarking a combination of a user-defined GraphQL server, going through a generic "GraphQL vendor", then going to the database, heavily biased towards a Prisma style of implementation and not applicable to anything else. Benchmarking is hard enough with just a server and a database, and adding a third component will make it harder to reason about the correctness of the benchmark.
Are there other GraphQL vendor or products that are GraphQL middleware/ORMs for authors of APIs other than Prisma and Dreamfactory, that you intend to benchmark with this suite?
Open-source servers like Postgraphile and Hasura (I work here) and vendor solutions like AppSync are meant to be GraphQL servers that are optimised for large numbers of HTTP clients querying for simple to complex real-world queries. It seems pointless to add a GraphQL delegation layer in front of these GraphQL servers.
Recommendation 1:
If this effort is intent on benchmarking the nascent ecosystem of "GraphQL vendors" I would recommend instead:
- Choose a dataset on a database with a fixed schema: This is important and reflective of the real world where data is modelled on a database for the database
- For the same choke point, write GraphQL queries as exposed by the GraphQL API of the vendor, even if the GraphQL queries have slightly differing syntax
Recommendation 2:
Instead, if this effort is meant to benchmark the broader process of writing GraphQL servers with a hand-written schema, I would recommend:
- Choose a GraphQL server implementation and choose a database ORM
- Write different optimised backends with different languages
- Write the same GraphQL queries that would test similar choke points that your benchmarking suite will run against.
From a usefulness point of view, I think the latter (recommendation 2) is very useful for folks in the community building GraphQL servers! This would become a very useful benchmark for folks building GraphQL servers that have to inevitably talk to a database and that need to choose between different ORMs and approaches to processing the GraphQL query.
I think the former (recommendation 1) is a benchmark of "GraphQL vendors". These are 2 different things and should be treated differently as such.