Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsegismont/graphql-server-benchmark

Benchmark of a simple GraphQL server on popular spec implementations
https://github.com/tsegismont/graphql-server-benchmark

benchmark graphql graphql-server

Last synced: about 2 months ago
JSON representation

Benchmark of a simple GraphQL server on popular spec implementations

Awesome Lists containing this project

README

        

= GraphQL server benchmark

Benchmark of a simple https://graphql.org/[GraphQL] server on popular spec implementations.

== Lastest results

link:results/round1/results.adoc[Round 1]

== The benchmark

The benchmark consists in a simple blogging GraphQL server:

* fetching json (author profiles) from a remote HTTP server
* reading rows (posts and comments) from a Postgres database

image::graphql-server-benchmark.svg[GraphQL Server Banchmark]

[source]
.Schema file
----
type Post {
author: Author!
title: String!
content: String!
comments: [Comment!]
}

type Comment {
author: Author!
post: Post!
content: String!
}

type Author {
firstName: String!
lastName: String!
bio: String!
posts: [Post!]
comments: [Comment!]
}

type Query {
posts: [Post!]
author(id: Int!): Author
}
----

The backend HTTP service is setup with 10 authors.

The Postgres database is setup with:

* 2 posts per author
* 2 comments per post:
** 1 comment from another author
** 1 comment (reply) from the post author

Each framework is tested with different link:queries.adoc[queries].

== Guidelines

The server must:

* accept the `BACKEND_HOST` environment variable for configuration
* accept the `POSTGRES_HOST` environment variable for configuration

The server may:

* cache author profiles per-query
* use HTTP and Postgres pipelining

The server must not:

* cache all posts and comments
* cache all author profiles

== Test environment

* 3 quad-core servers Intel Xeon e5-2637v3 128G RAM (injector, server, backend)
* 1 quad-core server Intel Xeon e5-2637v3 256G RAM (postgres)
* 10 GbE switch

== Contributing

You can add an implementation in the link:implementations/[implementations] directory.

Make sure the name describes the software stack.
For example, _Java/vertx-graphql-java_ means the implementation:

* is written in the Java language
* uses Vert.x as the web server
* uses GraphQL-Java engine

Each implementation must provide:

* a `Dockerfile` (build and run)
* a `set-env.sh` file that defines the `FRAMEWORK_NAME` implementation (must be unique across implementations)

For testing purposes, you can build and run with Docker:

* the link:backend/[backend] server
* the link:postgres/[postgres] database

== License

link:LICENSE[Apache 2.0 License]