Dropwizard – Guice – JDBI – Shiro – Liquibase (Part 1)

Hi folks! Welcome to my first tutorial. My name is Ivan Stragalis, and I am the Lead Software Analyst and CEO of Ether Mailer. On April 2015 I started investigating various Java libraries in order to build a solid framework, which would be the base of our brand new, java based, backend of Ether Mailer.

The Java framework should :

  1. Be a standalone java app, with no need of a Java Application Server (eg, Tomcat, JBoss, WebSphere, etc)
  2. Have dependency injection
  3. Have a well defined and developer-friendly JDBC library
  4. Be secured
  5. Be lightweight
  6. Support database migrations for future versions

I started playing around with Spring Boot and Dropwizard. I decided to give Dropwizard a chance. Although natively dropwizard does not support dependency injection, it seems more lightweight to me.

Regarding dependency injection, I am a big fun of Spring. But inserting spring into dropwizard would make no sense to choosing Dropwizard on the first place :) So I started working on inserting Guice into dropwizard.

Java always lacked a developer-friendly database library. Hibernate is not an option – maybe I will write another post for it. Using the JDBC library directly could be an option, although…. it is a pain in the @ss…. But… dropwizard already bundles with JDBI, a very convenient library on top of JDBC. I can say, I fell in love in JDBI!

Finally, database migrations would be crusial in the future. While adding more functionality, database changes is part of the business. So we would need a robust database migration library. Liquibase comes to the rescue!

So to conclude, we are going to use:

  1. Dropwizard
  2. Guice
  3. JDBI
  4. Apache Shiro
  5. Liquibase

In the following parts of this tutorial, I will explain how we combined all of the above libraries to build a solid framework, ready to fire!

Write a Reply or Comment

Your email address will not be published. Required fields are marked *

Start sending now. Try our free plan and get 10.000 emails for free!

Create your new account. It's just a few steps!