DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD...

51
DELIVERING WITH MICROSERVICES HOW TO ITERATE TOWARDS SOPHISTICATION 1

Transcript of DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD...

Page 1: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING WITH MICROSERVICES

!HOW TO ITERATE TOWARDS

SOPHISTICATION

1

Page 2: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHES !

PIZZA MOGUL

2

Page 3: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHESPIZZA MOGUL

3

Page 4: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHESNANO SERVICES

4

Page 5: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHESCOMPLEXITY

5

Page 6: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHESCROSS CUTTING CONCERNS

public void RefreshAllLeaderboards()!{! […]!! WithConnection(! connection => ! connection.Execute(DbTable + "UpdateAllLeaderboards", CommandType.StoredProcedure));!! […]!}

leaderboard-service

UpdateAllLeaboards

mogul-service pizza-service charity-service6

Page 7: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

FROM THE TRENCHESREFLECTIONS

microservices? need big upfront design?

7

Page 8: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DEFINE MICROSERVICES !

WHEN AGILE MEET DISTRIBUTED SYSTEMS

8

Page 9: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DEFINE MICROSERVICESDISTRIBUTED AND WEB ARCHITECTURES

C++

1980s

Java

1990s 2000s 2010s

XML JavaScriptANSI C

TCP/IP Client-Sever RPC

CORBA RMI

SOAP SOA

JSON REST

9

Page 10: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DEFINE MICROSERVICESSOFTWARE DEVELOPMENT METHODOLOGIES

RUP

XP Continuous Integration

AgileContinuous

Delivery

1980s 1990s 2000s 2010s

10

Page 11: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DEFINE MICROSERVICESXXXXXXXXXXXXX

Distributed & Web

Architecture

Agile & Continuous

DeliveryMicroservices

11

Page 12: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

Microservices

DEFINE MICROSERVICESAN ALTERNATIVE TO TRADITIONAL SOA

12

Page 13: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DEFINE MICROSERVICESREFLECTIONS

microservices? need big upfront design?

Microservices

13

Page 14: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSH !

WHAT MAKE THEM SO POPULAR?

14

Page 15: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHINTEREST

0 January 2014

June 2015

100

Google Trends Data

# “microservices” searches

15

Page 16: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHSCALE

"In order to scale to the next order of magnitude, we're rethinking the fundamentals of our architecture"

Philip Fisher-Ogden, Director of Engineering

"We created the viewing service to encapsulate the domain of viewing data collection, processing, and providing "

"These components would be easier to develop, test, debug, deploy, and operate if they were extracted into their

own services."

http://www.techrepublic.com/article/netflix-on-how-to-build-services-that-scale-beyond-millions-of-users/16

Page 17: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHBREAK THE MONOLITH

Monolithic Perl —> Monolithic C++ —> Java —> microservices

Monolithic C++ —> Perl / C++ —> Java / Scala -> microservices

Monolithic Rails —> JS / Rails / Scala —> microservices

17

Page 18: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHENDPOINTS AS FIRST CLASS CITIZEN

http://www.infoq.com/presentations/webber-guerilla-soa18

Page 19: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHBUSINESS VALUE FIRST

https://yow.eventer.com/yow-2011-1004/domain-driven-design-strategies-for-dealing-with-legacy-systems-by-eric-evans-103319

Page 20: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHA NEW ORGANISATION

"Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose

structure is a copy of the organization's communication structure."

Melvin Conway, How Do Committees Invent - 1968

20

Page 21: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

MICROSERVICES RUSHREFLECTIONS

microservices? need big upfront design?

Microservices

strategic value break the monolith scale re-org21

Page 22: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICES

!IN AN AGILE WAY

22

Page 23: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESTHE PROBLEM

Infrastructure

Features

Infrastructure

Features

PriceEstimationService

WatchlistService

23

Page 24: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESTHE GOAL

24

Page 25: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESJOURNEY

Capabilities

Discovery Release 1 Release 2 Release N…

25

Page 26: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESDISCOVERY - WHY MICROSERVICES

Discovery Release 1 Release 2 Release N…

26

Page 27: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESBUSINESS & ARCHITECTURE CONTRACT

27

Page 28: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESUSER JOURNEYS ACROSS SERVICES

28

Page 29: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - BUILD A MINILITH

Discovery Release 1 Release 2 Release N…

29

Page 30: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

minilith

DELIVERING MICROSERVICESRELEASE 1 - ARCHITECTURE

greenfield

brownfieldmonolith

minilith

minilithClient

Presentation

Biz Servicesservices

30

Page 31: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - CONTINUOUS DELIVERY

• CODE

• BUILD

• PLAN

• RELEASE • TO TEST FLIGHT

• CODE

• BUILD

• PLAN

• RELEASE • TO TEST FLIGHT

CODE

PLAN

BUILD

TEST

RELEASE TO PRODUCT OWNER

+ BETA

INSTALL

TRACK USAGE

USER FEEDBACK

Continuous Integration

Usability and Feedback Cycle

31

Page 32: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - CONTRACT TESTING

Functional

Integration

Unit Unit

Contracts

Web Application Web Services

32

Page 33: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

describe('with an email created', function() {!! beforeEach(function(done) {!! var requestOptions = {! url: config.serviceUrl + '/badge',! method: ‘POST',! json: {! 'mogulid': ‘********************************’,! 'badgecode': 'FirstSlice',! 'name': 'First Slice',! 'description': 'Awarded when a Mogul creates their first pizza',! 'imageurl': '/images/badges/firstslice.png',! 'bonusamount': '0'! }! };! request.get(requestOptions, function(err, response, body) {! postResponse = response;! postBody = body;! getEmails(done);! });! });!! it('returns the email', function() {! expect(postResponse.statusCode).toBe(201);! var xml = new dom().parseFromString(getBody);! expect(xpath.select('count(//*[local-name()=\'MogulEmail\'])', xml)).toBe(1); ! ! !! expect(xpath.select('count(//*[local-name()=\'Field\'])', xml)).toBe(9);! expect(xpath.select('//*[local-name()=\'MogulEmail\']', xml)[0].namespaceURI)!! ! ! .toBe('http://PizzaMogul.Integration.Communication.Schemas.MogulEmail');! });!! });

DELIVERING MICROSERVICESRELEASE 1 - CONTRACT TEST EXAMPLE

33

Page 34: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - DEPENDENCY GRAPHS WITH D3JS

D3 Sankey Diagram D3 Hierarchic Edge Bundlinghttp://techblog.netflix.com/2015/02/a-microscope-on-microservices.html https://www.youtube.com/watch?v=hsoovFbpAoE

34

Page 35: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - TRANSACTIONS LOGGING

pizza-service

pizza-image-service

media-service / 1 /!

ID: VN2CWYMM53

/ 2 /!ID: J1MFK7SDK3!

caused by VN2CWYMM53

/ 3 /!ID: UOZ41FS316!

caused by J1MFK7SDK3

35

Page 36: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - DIFFERENT LEVELS OF MONITORING

New Relic

Log Runtime Infrastructure

Logstash & Kibana

36

Page 37: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 1 - BUILD CAPABILITIES

• Continuously Deliver CI, automated builds, tests, and deployments, release management

• Re-think the pyramid of tests Favor contracts testing to UI functional testing

• Control dependencies Modules integration via HTTP, dependency graph, transaction logging

• Release to production Learn about your prod environment, consider containers and/or in-process lightweight web servers, load balancers, caching, etc…

• Monitor & Analyse Have system monitoring and data analytics in place.

37

Page 38: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - BREAK THE MINILITH

Discovery Release 1 Release 2 Release N…

38

Page 39: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - ARCHITECTURE

greenfield

brownfieldmonolith

Client

Presentation

Biz Servicesservices

services

services

39

Page 40: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - NEW SERVICE USE CASES

new bounded context scale separately

securitydata aggregation

40

Page 41: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICES!RELEASE 2 - ISOLATION

DATA

"No direct database access is allowed from outside the service, and there’s no data sharing among the services"

Werner Vogels, CTO and Vice President of amazon.com

41

Page 42: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICES!RELEASE 2 - ISOLATION

CONTAINERS

LXD

42

Page 43: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICES!RELEASE 2 - ISOLATION

INTEGRATION

Orchestration Choreography

http://www.thoughtworks.com/insights/blog/scaling-microservices-event-stream43

Page 44: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - SERVICE TEMPLATES

TO BE ADDED

44

Page 45: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - BUILD WHAT YOU CAN SUPPORT

45

Page 46: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE 2 - UNDERSTAND SERVICES

• Know if and when to create a new service new bounded context, aggregation, security, scale independently

• Define (your level of) isolation code, compilation, runtime, persistence, integration

• Reduce barrier to entry repository blueprint, pipeline template, scaffolding script

• Build what you can support develop DevOps culture (e.g. infrastructure as code)

46

Page 47: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE N - SCALE

Discovery Release 1 Release 2 Release N…

47

Page 48: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE N - SCALING FDELIVERY

SCALABLE ARCHITECTURE ??

48

Page 49: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

DELIVERING MICROSERVICESRELEASE N - SCALING FOR LOAD

DISTRIBUTING THE TEAMS?

49

Page 50: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

CONCLUSION

microservices? need big upfront design?

Microservices

strategic value break the monolith scale re-org50

Page 51: DELIVERING WITH MICROSERVICES - SlatteryIT · DELIVERING MICROSERVICES RELEASE 1 - BUILD CAPABILITIES • Continuously Deliver CI, automated builds, tests, and deployments, release

ABOUT ME

jeandamore

blog.corsamore.com

jeandamore

jdamore

Jean D’Amore Technology Market Principal

[email protected]

51