This repo contains three different parts.
- A GraphQL server implementation
- Database
- Test-driver
To setup and run the server/database together just run the docker-compose files.
For development:
docker-compose -f docker-compose.dev.yaml up
For production:
docker-compose up
This folder contains a server implementation that is intended to test different techniques that can be used when writing the resolvers for a GraphQL server. Such as caching and batching.
This server is implemented to work together with the mysql database in the database folder.
This folder contains the BSBMtools used to generate the dataset that is used in this project. The dockerfile accompanying the tools uses the tools to run the generator and inserts them into a mysql database. This image is used to easily spin up a database with generated data.
NOTE: Preferbly this is not done, use the docker-compose files instead.
- Build the image using a chosen products multiplier.
docker build -t benchmark-db --build-arg pc=2000 .
Default: pc=1000
- Run the database.
docker run -d -p 3306:3306 --name benchmark-db -e MYSQL_ROOT_PASSWORD=supersecret benchmark-db
- It is now possible to reach the database on port 3306 or you can access it using the following command.
docker exec -it benchmark-db bash
The program will together with given query-templates and variables benchmark the server. It will record the time it takes for each query to return from the server. It should be possible to tell the test-driver to run several "clients" at the same time to simulate concurrent requests to the server.