Top Banner
Modernizing Applications with Microservices Markus Eisele @myfear blog.eisele.net https://keybase.io/myfear
20

Modernizing Applications with Microservices

Apr 11, 2017

Download

Technology

Markus Eisele
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Modernizing Applications with Microservices

Modernizing Applications with Microservices

MarkusEisele@myfear

blog.eisele.nethttps://keybase.io/myfear

Page 2: Modernizing Applications with Microservices
Page 3: Modernizing Applications with Microservices

The Curse Of The Monolith

We know how to operate them

• We know how to develop• We know how to deploy • We know how to scale

but there is a price to pay

• Large code-bases• Hard to understand and modify• Complex configuration

Page 4: Modernizing Applications with Microservices
Page 5: Modernizing Applications with Microservices

What Are Microservices?SOA for DevOps

• Single, self-contained, autonomous

• Easy(er) to understand individually

• Scalability• Testing independently• Individually deployed, has own

lifecycle

• Single service going down should not impact other services

• Right technology stack for the problem (language, databases, etc)

• Fail fast• Faster innovation,

iteration

Page 6: Modernizing Applications with Microservices

“Microservices” is a lousy term• Size is irrelevant

We want flexible systems and organizations that can adapt to their complex environments, make changes without rigid dependencies and coordination, can learn, experiment, and exhibit emergent behavior.

Page 7: Modernizing Applications with Microservices

We need to build systems for flexibility and resiliency, not just efficiency and

robustness.

Page 8: Modernizing Applications with Microservices

Software DesignOuter Architecture

Methodology and Organization

Distributed Systems

Datacenter Operating System

Page 9: Modernizing Applications with Microservices

Software Design

Architecture Principles

• Single Responsible Principle• Service Oriented Architecture

– Encapsulation– Separation of Concern– Loose Coupling

• Hexagonal Architecture

Design Patterns

• Domain-driven Design• Bounded Contexts• Event Sourcing• CQRS• Eventual Consistency• Context Maps

Page 10: Modernizing Applications with Microservices

Design Best Practices

• Design for Automation• Designed for failure• Service load balancing and automatic scaling• Design for Data Separation• Design for Integrity• Design for Performance

Page 11: Modernizing Applications with Microservices

Strategies For Decomposing

Verb or Use Casee.g. Checkout UI

Noune.g. Catalog product service

Single Responsible Principlee.g. Unix utilities

Page 12: Modernizing Applications with Microservices

Load Balancer ServiceAA DBClient Cache

API G

atew

ay

Secu

rity

ServiceRegistry

Operational Capabilities (Scaling, SLA, Monitoring, Logging, Deployment)

Developer Enablement (Documentation, Discovery, Debugging)

Outer Architecture

Page 13: Modernizing Applications with Microservices

• Reactive Microservices Framework for the JVM• Focused on right sized services• Asynchronous I/O and communication as first class

priorities• Highly productive development environment• Takes you all the way to production

What is Lagom?

Page 14: Modernizing Applications with Microservices

• Service API• Persistence API• Development environment• Production environment

Highly opinionated

Page 15: Modernizing Applications with Microservices

• Event sourced (deltas) with Cassandra backend by default• No object/relational impedance mismatch• Can always replay to determine current state• Allows you to learn more from your data later• Persistent entity is an Aggregate Root in DDD• Can be overridden for CRUD if you want

Lagom Persistence API

Page 16: Modernizing Applications with Microservices

Next Steps! Download and try Lagom!Project Site:http://www.lightbend.com/lagom

GitHub Repo:https://github.com/lagom

Documentation:http://www.lagomframework.com/documentation/1.0.x/Home.html

Example:https://github.com/typesafehub/activator-lagom-java

Page 17: Modernizing Applications with Microservices

Written for architects and developers that must quickly gain a fundamental understanding of microservice-based architectures, this free O’Reilly report explores the journey from SOA to microservices, discusses approaches to dismantling your monolith, and reviews the key tenets of a Reactive microservice:

• Isolate all the Things• Act Autonomously• Do One Thing, and Do It Well• Own Your State, Exclusively• Embrace Asynchronous Message-Passing• Stay Mobile, but Addressable• Collaborate as Systems to Solve Problems

http://bit.ly/ReactiveMicroservice

Page 18: Modernizing Applications with Microservices

The detailed example in this report is based on Lagom, a new framework that helps you follow the requirements for building distributed, reactive systems.

• Get an overview of the Reactive Programming model and basic requirements for developing reactive microservices

• Learn how to create base services, expose endpoints, and then connect them with a simple, web-based user interface

• Understand how to deal with persistence, state, and clients

• Use integration technologies to start a successful migration away from legacy systems

http://bit.ly/DevelopReactiveMicroservice

Page 19: Modernizing Applications with Microservices

http://bit.ly/SustainableEnterprise

• Understand the challenges of starting a greenfield development vs tearing apart an existing brownfield application into services

• Examine your business domain to see if microservices would be a good fit

• Explore best practices for automation, high availability, data separation, and performance

• Align your development teams around business capabilities and responsibilities

• Inspect design patterns such as aggregator, proxy, pipeline, or shared resources to model service interactions

Page 20: Modernizing Applications with Microservices