Dropwizard

Dropwizard

"Dropwizard straddles the line between being a library and a framework. Its goal is to provide performant, reliable implementations of everything a production-ready web application needs. Because this functionality is extracted into a reusable library, your application remains lean and focused, reducing both time-to-market and maintenance burdens."

What is Dropwizard

  • Grew out of Yammer
  • Open Source web framework
  • Small (few thousand LOC)
  • Glue code
  • Best of breed libraries
  • Embedded servlet container

Parts

  • Jetty - Java servlet container
  • Jersey - REST-support
  • Jackson - JSON-library
  • JDBI - Database abstraction layer built on JDBC
  • Metrics - High performance runtime metrics

Deployment

  • Compress container, app and libs in a single JAR
  • Versioned releases of everything!
  • Cuts down requirement to Java
  • Fast - A few seconds to start up application
  • Easy to start and debug from within an IDE
  • Support to boot up real container for integration tests
  • java -jar app.jar server config.yaml

Jetty

  • Created 1995
  • Servlet support since 1998
  • Latest version supports HTTP 2, Servlet 3.1, websockets
  • Used by: Google App Engine, Netflix, Hadoop, ActiveMQ, Maven, Apache Spark, FUSE, Airbnb, Riot Games

Jersey

  • Support for RESTful applications
  • Reference implementation of JAX-RS
  • Developed by Oracle
  • Basically used by everyone except JBoss

Appserver difference

  • Not tied to Java EE standardization
  • Very little overhead, both in dev time and performance
  • Tiny - Start small and add extra modules
  • Only community support
  • Little runtime management support
  • Metrics included out of the box
  • Health checks support
  • Easy and extendable configuration

Other

  • Java 8 support!
  • Dependency injection not included out of the box
  • Perhaps not opinionated enough
  • Some parts like logging not fully configurable
  • Few official module
  • Lots of community provided modules