Closed ksilz closed 1 year ago
You would like likely want to have a Maven profile which would determine which DB driver is used. That way you will ensure that the built artifact never has more runtime footprint than necessary.
@geoand If I understand you correctly, you're saying that if I build the app as described above, then it'd be bigger than it should be? Because the Postgres drivers are still included?
Exactly.
The difference will likely be negligible, but still, if you are looking for the best way, Maven profiles is the way to go.
Although, I would question why one would need to use H2 at all, since using Postgres is a zero configuration task with Quarkus
On Thu, Jan 26, 2023, 01:17 Karsten Silz @.***> wrote:
@geoand https://github.com/geoand If I understand you correctly, you're saying that if I build the app as described above, then it'd be bigger than it should be? Because the Postgres drivers are still included?
— Reply to this email directly, view it on GitHub https://github.com/redhat-developer-demos/quarkus-petclinic/issues/11#issuecomment-1404348808, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBMDP7I5PPOHULQJU5N4Z3WUGYAZANCNFSM6AAAAAAUF74BE4 . You are receiving this because you were mentioned.Message ID: @.***>
@geoand Thank you for the explanation!
The reason for H2 is that my talk will include a link to the Quarkus PetClinic repo and instructions on how to run & build it. And there, it's always easier if it's self-contained, without external dependencies. I will probably also note how to connect to Postgres, but not explain how to set up Postgres.
I may test the PetClinic with the Postgres driver for the talk, as this is the most realistic result.
For my conference talks at JavaLand 2023 and JAX Mainz 2023, I want to compare startup time & memory consumption of the Spring Boot PetClinic with the Quarkus PetClinic. Right now, that's not an apples-to-apples comparison, as Spring uses H2 out of the box and Quarkus does not.
So I added H2 with
mvn quarkus:add-extension -Dextensions="jdbc-h2"
and changed theapplication.properties
as below. Then I ranmvn package -DskipTests=true
. The resultingquarkus-petclinic-1.0.0-SNAPSHOT-runner.jar
uses 280M of memory on my M1 Mac with OpenJDK 15, as shown bytop -pid [process id] -stats mem
.Is this the smallest Quarkus Project I can get? If not, what else do I need to change?