Microservice Architecture
Dropwizard Vs Spring Boot
Nenad Pečanac
Serengeti
Contents
1) Definition
2) Monolithic architecture
3) Microservice arhitecture
4) Pros and Cons
5) Dropwizard Vs Spring Boot
6) References
1) Definition
Microservice architecture
“Microservice architectural style is an approach to
developing a single application as a suite of small
services, each running in its own process and
communicating with lightweight mechanisms,
often an HTTP resource API.”
Martin Fowler, ThoughtWorks
2) Monolithic architecture
Monolithic architecture
Monolithic architecture
Classical architecture.
Application is built as a single unit.
Typical 3 layer EA:
- client-side UI (Browser, HTML + JS)
- a database (RDBMS, NoSql ..)
- server-side application
(Java, .NET, Ruby, Python, PHP ..)
Monolithic architecture
The server-side application
- will handle HTTP requests
- execute domain logic
- retrieve and update data from the database
- select and populate HTML views
This server-side application is a
Monolith - Single logical executable.
Monolithic architecture
Monolithic server - natural approach
All logic for handling a request runs in a single
process, divided and organized into classes,
functions, and namespaces.
Application is developed on a developer's laptop,
deployed to a testing environment and after that to
production environment.
Monolith is horizontally scaled by running many
instances behind a load-balancer.
Monolithic architecture – drawbacks
Any changes to the system involve building and
deploying a new version of the application.
Changes require good planning and coordination.
Changes are expensive.
It is hard to keep a good modular structure.
Scaling requires scaling of the entire application
rather than parts of it that require greater resource.
Long release cycles.
Monolithic architecture
Example
3) Microservice architecture
Microservice architecture
Microservice architecture
Applications naturally start as Monoliths, they
scale and evolve to Microservice architecture.
Applications are then decomposed to components –
smaller independent service applications.
Components are very simple and loosely coupled.
Microservice architecture
Decentralized data management.
Decentralized governance.
Microservice architecture
They are built around business capabilities.
Each component runs as a separate application,
clustered to as many nodes as required.
Microservice architecture
Applications aim to be as decoupled and
as cohesive as possible.
Components usually communicate through REST.
Components sometime use lightweight messaging
(RabbitMQ, Zero MQ).
There is NO ESB or any other form of central
communication management.
Mikroservisna arhitektura
Smart endpoints an dumb pipes:
Microservice architecture
Components are designed for failure.
Any service can fail, anytime.
The client has to respond as gracefully as possible.
It's important to be able to detect the failures quickly
and, if possible, automatically restore service.
Microservice applications put a lot of emphasis on
real-time monitoring.
Microservice architecture
Netflix's Chaos Monkey induces failures of services
during the working day to test the application's
resilience and monitoring.
Microservices <->Classic SOA
SOA
XML
Complex to integrate
Heavy
Requires tooling
HTTP/SOAP
Microservices
JSON
Easy to integrate
Lightweight
Light tooling
HTTP/REST
Mikroservisna arhitektura
Who uses Microservices in Production?
Microservice architecture
Example
Microservice architecture
API Gateway
4) Pros and Cons
Microservice architecture - Pros
Multiple developers and teams can deliver relatively 
independently of each other.
May be written in different programming languages.
May be managed by different teams.
May use different data storage technologies.
Centralized management is minimal.
Microservice architecture - Pros
Independently deployable by fully automated
deployment machinery.
Works well with Contionous delivery.
Allows frequent releases while keeping the rest
of the system available and stable.
Microservice architecture - Cons
Distributed system complexity.
Inter-service communication complexity.
Distributed transactions between services don’t exist.
Significant operations overhead.
Difficult testing - Interactions between the services
Robust error handling and recovery is required.
Sophisticated real-time monitoring required.
5) Dropwizard Vs Spring Boot
Dropwizard Vs Spring Boot
Both are microservice containers and
rapid development frameworks.
Convention over configuration.
Applications are deployed as standalone JAR
files with embedded lightweight servers
(Jetty, Tomcat, Undertow)
Built in monitoring, logging and health checks.
Easy to leverage existing libraries.
Dropwizard Vs Spring Boot
Dropwizard Vs Spring Boot
Dropwizard is built on Jetty.
Spring Boot is focused on Spring applications,
supports Tomcat, Jetty or Undertow.
Dropwizard puts its REST support with Jersey.
Spring Boot has REST implementation based
on Spring Framework’s core.
Dropwizard uses Logback, Spring offers a
choice between Logback, Log4j and Log4j2.
Dropwizard Vs Spring Boot
Main difference between both frameworks is
dependency injection support.
Spring’s core comes with it’s built in dependency
injection support while with Dropwizard this
doesn’t come out of the box.
Both frameworks have a special module for testing
including JUnit and Mockito dependencies.
Dropwizard Vs Spring Boot
Conclusion
1) Spring Boot is a part of Spring ecosystem
and suits best for Spring-oriented projects
2) Spring offers broader list of supported services
- REST, JMS, Messaging...
3) Dropwizard offers integrations
with other DI frameworks like Guice, CDI …
4) Dropwizard owns popular metrics library
6) References
References
Martin Fowler: Microservices
Craig Richardson: Microservice Architecture Pattern
Craig Richardson: Decomposing Applications
Stefan Borsje: How we built microservcies at Karma
Benjamin Wootton: Microservices - Not a free lunch
Dropwizard: http://www.dropwizard.io/
Spring Boot: http://projects.spring.io/spring-boot/
Alex Zhitnitsky: Dropwizard Vs Spring Boot
Rizvan Ulah: Dropwizard Vs Spring Boot

Microservice Architecture JavaCro 2015

  • 1.
    Microservice Architecture Dropwizard VsSpring Boot Nenad Pečanac Serengeti
  • 2.
    Contents 1) Definition 2) Monolithicarchitecture 3) Microservice arhitecture 4) Pros and Cons 5) Dropwizard Vs Spring Boot 6) References
  • 3.
  • 4.
    Microservice architecture “Microservice architecturalstyle is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.” Martin Fowler, ThoughtWorks
  • 5.
  • 6.
  • 7.
    Monolithic architecture Classical architecture. Applicationis built as a single unit. Typical 3 layer EA: - client-side UI (Browser, HTML + JS) - a database (RDBMS, NoSql ..) - server-side application (Java, .NET, Ruby, Python, PHP ..)
  • 8.
    Monolithic architecture The server-sideapplication - will handle HTTP requests - execute domain logic - retrieve and update data from the database - select and populate HTML views This server-side application is a Monolith - Single logical executable.
  • 9.
    Monolithic architecture Monolithic server- natural approach All logic for handling a request runs in a single process, divided and organized into classes, functions, and namespaces. Application is developed on a developer's laptop, deployed to a testing environment and after that to production environment. Monolith is horizontally scaled by running many instances behind a load-balancer.
  • 10.
    Monolithic architecture –drawbacks Any changes to the system involve building and deploying a new version of the application. Changes require good planning and coordination. Changes are expensive. It is hard to keep a good modular structure. Scaling requires scaling of the entire application rather than parts of it that require greater resource. Long release cycles.
  • 11.
  • 12.
  • 13.
  • 14.
    Microservice architecture Applications naturallystart as Monoliths, they scale and evolve to Microservice architecture. Applications are then decomposed to components – smaller independent service applications. Components are very simple and loosely coupled.
  • 15.
    Microservice architecture Decentralized datamanagement. Decentralized governance.
  • 16.
    Microservice architecture They arebuilt around business capabilities. Each component runs as a separate application, clustered to as many nodes as required.
  • 17.
    Microservice architecture Applications aimto be as decoupled and as cohesive as possible. Components usually communicate through REST. Components sometime use lightweight messaging (RabbitMQ, Zero MQ). There is NO ESB or any other form of central communication management.
  • 18.
  • 19.
    Microservice architecture Components aredesigned for failure. Any service can fail, anytime. The client has to respond as gracefully as possible. It's important to be able to detect the failures quickly and, if possible, automatically restore service. Microservice applications put a lot of emphasis on real-time monitoring.
  • 20.
    Microservice architecture Netflix's ChaosMonkey induces failures of services during the working day to test the application's resilience and monitoring.
  • 21.
    Microservices <->Classic SOA SOA XML Complexto integrate Heavy Requires tooling HTTP/SOAP Microservices JSON Easy to integrate Lightweight Light tooling HTTP/REST
  • 22.
    Mikroservisna arhitektura Who usesMicroservices in Production?
  • 23.
  • 24.
  • 25.
  • 26.
    Microservice architecture -Pros Multiple developers and teams can deliver relatively  independently of each other. May be written in different programming languages. May be managed by different teams. May use different data storage technologies. Centralized management is minimal.
  • 27.
    Microservice architecture -Pros Independently deployable by fully automated deployment machinery. Works well with Contionous delivery. Allows frequent releases while keeping the rest of the system available and stable.
  • 28.
    Microservice architecture -Cons Distributed system complexity. Inter-service communication complexity. Distributed transactions between services don’t exist. Significant operations overhead. Difficult testing - Interactions between the services Robust error handling and recovery is required. Sophisticated real-time monitoring required.
  • 29.
    5) Dropwizard VsSpring Boot
  • 30.
    Dropwizard Vs SpringBoot Both are microservice containers and rapid development frameworks. Convention over configuration. Applications are deployed as standalone JAR files with embedded lightweight servers (Jetty, Tomcat, Undertow) Built in monitoring, logging and health checks. Easy to leverage existing libraries.
  • 31.
  • 32.
    Dropwizard Vs SpringBoot Dropwizard is built on Jetty. Spring Boot is focused on Spring applications, supports Tomcat, Jetty or Undertow. Dropwizard puts its REST support with Jersey. Spring Boot has REST implementation based on Spring Framework’s core. Dropwizard uses Logback, Spring offers a choice between Logback, Log4j and Log4j2.
  • 33.
    Dropwizard Vs SpringBoot Main difference between both frameworks is dependency injection support. Spring’s core comes with it’s built in dependency injection support while with Dropwizard this doesn’t come out of the box. Both frameworks have a special module for testing including JUnit and Mockito dependencies.
  • 34.
    Dropwizard Vs SpringBoot Conclusion 1) Spring Boot is a part of Spring ecosystem and suits best for Spring-oriented projects 2) Spring offers broader list of supported services - REST, JMS, Messaging... 3) Dropwizard offers integrations with other DI frameworks like Guice, CDI … 4) Dropwizard owns popular metrics library
  • 35.
  • 36.
    References Martin Fowler: Microservices CraigRichardson: Microservice Architecture Pattern Craig Richardson: Decomposing Applications Stefan Borsje: How we built microservcies at Karma Benjamin Wootton: Microservices - Not a free lunch Dropwizard: http://www.dropwizard.io/ Spring Boot: http://projects.spring.io/spring-boot/ Alex Zhitnitsky: Dropwizard Vs Spring Boot Rizvan Ulah: Dropwizard Vs Spring Boot