54
@crichardson Microservices: enabling the rapid and reliable delivery of complex applications Chris Richardson Founder of Eventuate.io Founder of the original CloudFoundry.com Author of POJOs in Action @crichardson [email protected] http://microservices.io http://eventuate.io http://plainoldobjects.com Copyright © 2017. Chris Richardson Consulting, Inc. All rights reserved

Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Embed Size (px)

Citation preview

Page 1: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Microservices: enabling the rapid and reliable delivery of

complex applicationsChris Richardson

Founder of Eventuate.io Founder of the original CloudFoundry.com Author of POJOs in Action

@crichardson [email protected] http://microservices.io http://eventuate.io http://plainoldobjects.com

Copyright © 2017. Chris Richardson Consulting, Inc. All rights reserved

Page 2: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Presentation goal

How the microservice architecture accelerates the delivery of large, complex software applications

Page 3: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

About Chris

Page 4: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

About Chris

Consultant and trainer focusing on modern

application architectures including microservices

(http://www.chrisrichardson.net/)

Page 5: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

About Chris

Founder of a startup that is creating an open-source/SaaS platform

that simplifies the development of transactional microservices

(http://eventuate.io)

Page 6: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

About Chris

http://learnmicroservices.io

Page 7: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Agenda

The need for DevOps and continuous delivery

From monolith to microservices

Microservices != silver bullet

Refactoring to microservices

Page 8: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Traditional developmentW

all o

f con

fusio

nRequirements

Business

Wall

of c

onfu

sion

Architecture/ Design

Architects

Wall

of c

onfu

sion

Code

Developers

Wall

of c

onfu

sion

Tested code

QA Ops

Capacity planning Procure hardware

Page 9: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Months later…Business discovers customers want something different

Developers discover there are bugs

Operations discover their capacity planning estimates were wrong

Over-provision => waste money

Under-provision => success catastrophe

Page 10: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

What is DevOps?

Set of practices where developers, testers

(dev) and IT operations (ops) collaborate and

communicate to deliver software rapidly,

frequently, and reliably

http://itrevolution.com/devops-handbook

Page 11: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

DevOps/Continuous Delivery =

table stakes for playing in highly competitive industries

Mark Schwartz, A seat at the table

Page 12: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Reducing lead time

Increasing deployment frequency

Page 13: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Modern software development: moving fast and not breaking things!

46x

440x

24x

5x lower

Amazon: ~0.001%

Netflix: 16 minutes

Page 14: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Architecture ⇒

Maintainability

Testability

Deployability

Development velocity

Page 15: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Agenda

The need for DevOps and continuous delivery

From monolith to microservices

Microservices != silver bullet

Refactoring to microservices

Page 16: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Tomcat/App. Server

Traditional: Monolithic architecture

Browser/Client

WAR/EAR

MySQL Database

Review Module

Catalog Module

Recommendation Module

StoreFrontUI

Order Module

HTMLREST/JSON

Logical viewImplementation view

Page 17: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

The monolithic architecture is an architectural style

that structures the application as a single executable

component

Implementation view

Page 18: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

-ilities of small monoliths

Maintainability

Testability

Deployability

https://en.wikipedia.org/wiki/Non-functional_requirement

😄

Page 19: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

But successful applications keep growing….

Development Team Application

Page 20: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

… and growing

Development Team A

ApplicationDevelopment Team B

Development Team C

Page 21: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Eventually:

agile development

and deployment becomes

impossible

=

monolithic hell

Page 22: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

-ilities of large monoliths

Maintainability

Testability

Deployability

https://en.wikipedia.org/wiki/Non-functional_requirement

😭

Page 23: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Technology stack becomes increasingly obsolete

BUT A rewrite is not feasible

Page 24: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

The microservice architecture is an architectural style

that structures an application as a

set of loosely coupled, services organized around

business capabilities

Page 25: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Application

Service = business capabilityAcme, Inc

Order Taking

Inventory management

Delivery management

Business Capability = something a business does to deliver value

Order Service

Inventory Management

Service

Delivery Management

Service … Service

Page 26: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Service size is secondary

microservice architecture

Page 27: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Service:

Meaningful business functionality

Developed by a small team

Minimal lead time/high deployment frequency

Page 28: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Browser

Mobile Device

Content Router

API Gateway

Catalog Service

Review Service

Order Service

… Service

Catalog Database

Review Database

Order Database

… Database

HTTP /HTML

REST

REST

Browse & Search WebApp

Product Detail WebApp

….

Supplier Inbound Gateway

Catalog update messages

Supplier System

Page 29: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

-ilities of a microservice architecture

Maintainability

Testability

Deployability

https://en.wikipedia.org/wiki/Non-functional_requirement

😄

Page 30: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Microservices ⇒ continuous delivery/deployment

of large/complex applications

Page 31: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Process: Continuous delivery/deployment

Organization:Small, agile, autonomous,

cross functional teams

Architecture: Microservice architecture

Enables

Enables Enables

SuccessfulSoftware

Development

Services improve testability

and deployability

Teams own services

Page 32: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Microservices ⇒ evolve the technology stack

Pick a new technology when

Writing a new service

Making major changes to an existing service

Let’s you experiment and fail safely

Page 33: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Agenda

The need for DevOps and continuous delivery

From monolith to microservices

Microservices != silver bullet

Refactoring to microservices

Page 34: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

No silver bullets

http://en.wikipedia.org/wiki/Fred_Brooks

Page 35: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Drawbacks of microservices

Complexity

Development: IPC, partial failure, distributed data Testing: Integration, end to end, …Deployment …

Page 36: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Are microservices a good fit for my application?

Page 37: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Do I have the pre-requisites in place:

automated testing automated provisioning ….. ?

Page 38: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

When using microservices:How to decompose an application into services?

How to deploy an application’s services?How to handle cross cutting concerns?

Which communication mechanisms to use?

How do external clients communicate with the services?

How does a client discover the network location of a service instance?

How to prevent a network or service failure from cascading to other services?

How to maintain data consistency and implement queries?

How to make testing easier?

How to understand the behavior of an application and troubleshoot problems?

How to implement a UI screen or page that displays data from multiple services?

Page 39: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

It depends!

Page 40: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Microservice pattern language =

collection of patterns that solve these

architecture, design, development and operational problems

Page 41: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

What’s a pattern?

Reusable solution to a problem

occurring in a particular context

Page 42: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

The structure of a pattern encourages objectivity

Resulting context

aka the situation

Name

Context

Problem

Related patterns

(conflicting) issues etc to address Forces

Solution Benefits

Drawbacks

Issues to resolve

Alternatives

Solutions to issues

Page 43: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Microservices pattern language: http://microservices.io

Page 44: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Agenda

The need for DevOps and continuous delivery

From monolith to microservices

Microservices != silver bullet

Refactoring to microservices

Page 45: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

How do you decompose your big, scary monolithic application?

Page 46: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Best done incrementally!

Page 47: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Strangler Application

https://en.wikipedia.org/wiki/Strangler_fig

http://www.martinfowler.com/bliki/StranglerApplication.html

Page 48: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Strategy: New functionality = service

Monolith ServiceData integration glue

API Gateway

Request

Monolithic database

Service database

Enables service to access monolith’s data

Page 49: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Strategy: Existing module ⇒ service ...

Monolith

Module

Monolithic database

Module tables

Page 50: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Define a “remotable” interface

In-process ACL

Application

Module

Monolithic database

Module tables

Page 51: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

... Module ⇒ service

Monolith ServiceData integration glue

Monolithic database Module Database

API Gateway

Request

Page 52: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

Summary

Modern software development = DevOps/Continuous Delivery

Use the appropriate architecture

Small applications ⇒ Monolithic architecture

Complex applications ⇒ Microservice architecture

Use the pattern language to guide your decision making

Incrementally refactoring a monolith to microservices

Page 53: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

@crichardson

@crichardson [email protected]

http://learnmicroservices.io

Thank you!

Page 54: Omnikron webbinar - Microservices: enabling the rapid, frequent, and reliable delivery of complex applications

Thank You!

• Earn that additional PDU – complete the survey!

• Certificates

• Upcoming webinar

• A word from our Sales Director, Brad Emm