Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Micro-services with Dropwizard

Micro-services with Dropwizard

Micro-services are a pattern for building small, single responsibility services that can be independently deployed and orchestrated as part of a larger services oriented architecture. Dropwizard is a Java framework for building RESTful webservices that are high-performance and developer friendly. It is mostly glue around stable and best-of-breed java libraries like Jersey, Jetty, and Jackson. We will talk about how Dropwizard addresses configuration, metrics, and logging.


Kyle Boon

March 27, 2014

More Decks by Kyle Boon

Other Decks in Programming


  1. Micro-services with Dropwizard Kyle Boon

  2. Kyle Boon Team Lead @ Bloomhealth kyle.f.boon@gmail.com @kyleboon http://www.kyleboon.org

  3. Architecture 2011

  4. Architecture 2012

  5. Architecture 2013

  6. Micro-service architecture is the composition an application by multiple component

  7. Micro-services are about single- responsibility and bounded countexts

  8. Independance on various axes Select implementation and storage technology Test

    Deploy to production Recover from failure Monitor Horizontally scale Replace http://literateprogrammer.blogspot.com/2014/03/the-microservice-declaration-of.html
  9. Conway's Law implies that micro-services lead to small independent teams

  10. Frameworks for micro-services Dropwizard Ratpack Spring Boot Finegle Scalatra Sinatra

  11. The stack at BloomHealth Groovy for programming Grails for web

    applications Dropwizard for JSON web services Gradle for builds Swagger for Service Discovery Spock for testing Gatling for Performace/Load Testing Redis for Caching RabbitMQ for messaging
  12. What is Dropwizard Dropwizard is a heavily opinionated framework for

    building web services on the JVM. It is mostly glue around mature java libraries like Jetty, Jersey, Jackson and Guava. Dropwizard has out-of-the-box support for sophisticated configuration, application metrics, logging, operational tools, and much more, allowing you and your team to ship a production-quality HTTP+JSON web service in the shortest time possible.
  13. Who Created it? @coda As I've said before, the only

    reason Dropwizard exists at all is to provide opinions on what a service should be. I think they work better.It embeds Jetty because I think that works better.It uses Jackson because I think that works better.It uses Jersey because I think that works better.It has a single YAML configuration file because I think that works better. It wraps Logback because I think that works better.
  14. It's fast

  15. User dropwizard if you want get stuff done; don't use

    dropwizard if you want to shave yaks
  16. The Application Services are a collection of bundles, commands, healthchecks,

    tasks and resources. The service class defines all of the abilities of your application.
  17. The Resource Resources model what is exposed via your RESTful

    API. Dropwizard uses Jersey for this so these classes are mostly jersey annotations.
  18. The Representation Your POJOs will be turned into JSON via

    Jackson. Hibernate Validator lets you specify validation rules.
  19. Bundles Bundles are reusable blocks of behaviour designed to be

    reused across services. Assets, Hibernate and Liquibase are all implemented as Dropwizard Bundles.
  20. Commands Commands add options to the command line interface of

    your service. For example the server starts based on the 'server' command. Migrations run based on the 'db migrate' command. You might add your own command for running functional tests or seeding the database.
  21. Tasks Tasks are run time actions available over the administration

    port. Dropwizard ships with a garbage collection task. You might want to right a task to clean a cache by key.
  22. Other Stuff Configuration Logging Hibernate/JDBI Clients Authentication Views

  23. References - Microservices Martin Fowler on Micro-services Less micro more

    service What are micorservices? Presentation: Micro-services the Unix way Microservice declaration of independence
  24. References - Dropwizard Dropwizard User Guide Dropwizard User Group https://github.com/codahale/dropwizard

    Presentation about Dropwizard @ Yammer Presentation about Dropwizard @ Simple Coda Hale and Metrics Coda Hale and the Programming Ape