Skip to content

Some Quarkus applications that are able to show framework's key points concisely while comparing to a traditional Spring application

Notifications You must be signed in to change notification settings

limadelrey/spring-vs-quarkus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring vs Quarkus

The goal of this repository is to provide a reduced number of applications that are able to show Quarkus key points concisely while comparing it to a traditional Spring application:

  1. spring-rest-api is built with Spring. It provides a REST API and persists data on a PostgreSQL database;
  2. quarkus-rest-api is built with Quarkus in an imperative way and it's very similar to spring-rest-api. It provides a REST API and persists data on a PostgreSQL database;
  3. quarkus-reactive-rest-api is built with Quarkus in a reactive way. It provides a REST API, persists data on a PostgreSQL database, generates an OpenAPI specification while providing a representation using Swagger UI and generates metrics on OpenMetrics specification while providing a representation using Prometheus.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Java 11
Maven 3.6.1
Docker 19.03.5

Running

Create Docker network

$ docker network create book-store-network

Build & run Spring application

Generate fat .jar:

$ mvn clean package spring-boot:repackage

Build docker compose w/ database and application containers:

$ docker-compose build

Run docker compose w/ database and application containers:

$ docker-compose up

Build & run Quarkus application

Run with live reload (test and dev purposes):

$ mvn compile quarkus:dev

Generate fat .jar:

$ mvn clean package

Or generate native executable:

$ mvn clean package -Pnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:19.3.1-java11

Build docker compose w/ database, migrations, monitoring and application containers:

$ docker-compose build

Run docker compose w/ database, migrations, monitoring and application containers:

$ docker-compose up

Run stress tests

Run Apache Bench stress tests:

$ ab -n 10000 -c 10 http://localhost:8080/api/v1/books 

If you don't have Apache Bench, run the following Docker container:

$ docker run --rm jordi/ab -n 10000 -c 10 http://localhost:8080/api/v1/books/ 

Other informations

Useful endpoints:

Access Prometheus:

Built With

About

Some Quarkus applications that are able to show framework's key points concisely while comparing to a traditional Spring application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published