This repository contains a set of microservices that connect to a database using different connection methods (JDBC, R2DBC, etc.) and a set of Gatling performance tests to compare their performance under load.
To build and run this application you need to install the followings:
On macOS, you can use these commands (assuming that Homebrew is already installed):
brew install openjdk@21
brew install --ignore-dependencies maven
brew install podman
brew install podman-composeThe following command will read docker-compose.yml, pull the images and then starts the containers in detached mode.
podman-compose up -dmvn clean installFirst you will need to start the module
cd <module-name>/
java -jar target/service.jarYou can see the available endpoints by going to Swagger UI
Then for running the tests run the following commands:
cd perfromance-tests/
mvn -nsu gatling:test-nsu argument is for not updating the snapshot dependencies from remote servers
Run the ArticleSimulation with 5000 users for 3 times and took the last results.
| OK: t < 800 ms | OK: 800 ms <= t < 1200 ms | OK: t >= 1200 ms | Failed | |
|---|---|---|---|---|
| reactive-mongo | 17,447 | 1,310 | 1,243 | 0 |
| reactive-mysql | 14,813 | 1,678 | 2,937 | 143 |
| sync-mongo | 11,368 | 3,135 | 5,497 | 0 |
| sync-jdbc-mysql | 8,846 | 764 | 10,250 | 35 |
| sync-jpa-mysql | 968 | 890 | 18,118 | 6 |