Skip to content

octavian-h/db-comparison

Repository files navigation

DB connection comparison using Gatling load testing

Description

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.

Requirements

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-compose

Usage

1. Start the containers

The following command will read docker-compose.yml, pull the images and then starts the containers in detached mode.

podman-compose up -d

2. Build the project

mvn clean install

3. Run the performance test for a given module

First you will need to start the module

cd <module-name>/
java -jar target/service.jar

You 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

Results

Spike testing

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

About

DB connection comparison using Gatling load testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published