Slide 1

Slide 1 text

Microservices Technology Stack Eberhard Wolff Fellow, innoQ @ewolff

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

http://microservices-buch.de/ http://microservices-book.com/

Slide 4

Slide 4 text

http://microservices-book.com/primer.html FREE!!!!

Slide 5

Slide 5 text

Microservices = Independent Deployment Units

Slide 6

Slide 6 text

Why can’t I just deploy Microservices on an Java EE server?

Slide 7

Slide 7 text

Microservices are just small REST services, right?

Slide 8

Slide 8 text

Integration

Slide 9

Slide 9 text

Components Collaborate Micro Service Micro Service Link Data Replication REST Messaging

Slide 10

Slide 10 text

UI Integration

Slide 11

Slide 11 text

Browser Order History Recommendation Order Microservice Recommendation Microservice

Slide 12

Slide 12 text

Server-side integration Browser UI 1 UI 2 Frontend Server Backend 1 Backend 2

Slide 13

Slide 13 text

Server-side Integration: Technologies > ESI (Edge Side Include) > E.g. Varnish cache > SSI (Server Side Include) > E.g. Apache httpd, nginx > Portal Server + Portlets

Slide 14

Slide 14 text

ESI (Edge Side Includes) ...
... a lot of static content and images ...
... ... ... Logged in as: Ada Lovelace ...
some dynamic content

Slide 15

Slide 15 text

ESI (Edge Side Includes) ...
... a lot of static content and images ...
... ... http://www.w3.org/TR/esi-lang

Slide 16

Slide 16 text

Portal Server > Broad support and used in many projects > Compose web application of Portlets > Portlets might be deployed independently Portal Server Portlet 1 Portlet 2 Browser UI 1 UI 2

Slide 17

Slide 17 text

Portal Server: Challenges > Do not really integrate diverse backends > Web Services for Remote Portlets (WSRP) still require Portlets > Portlets allow customization by user… > ...which make them very different from normal web applications

Slide 18

Slide 18 text

Portal Server > No support for non-Java technologies > Programming model very different from normal web applications > Why would you use Portal Servers?

Slide 19

Slide 19 text

Client-side integration > Client requirements (e.g. CORS, JS) > Upcoming: HMTL Imports Browser UI 1 UI 2 Backend 1 Backend 2

Slide 20

Slide 20 text

Client-side Integration: Code $("a.embeddable").each(function(i, link) { $("
").load(link.href, function(data, status, xhr) { $(link).replaceWith(this.children); }); }); > Replace with content of document in a
(jQuery)

Slide 21

Slide 21 text

Logic Integration

Slide 22

Slide 22 text

Messaging Microservice Microservice ! ! !

Slide 23

Slide 23 text

Messaging > Natural fit for asynchronous communications > E.g. event-driven > Decoupling: Sender and Receiver only know topic / queue > Re-submission for resilience > Not natural for synchonous communication

Slide 24

Slide 24 text

REST ? # Microservice Microservice

Slide 25

Slide 25 text

REST > Natural fit for synchronous communications > Evolvability with HATEOS > Content negiotation > Not natural for asynchonous communication

Slide 26

Slide 26 text

https://jaxenter.de/ microservices-rest-vs- messaging-29875

Slide 27

Slide 27 text

Service Discovery > Services need to find each other > Enables load balancing > For REST only > E.g. DNS

Slide 28

Slide 28 text

Netflix Eureka > Cache on the client > Quick > Proven > Support for non-Java systems with sidecar only > No DNS

Slide 29

Slide 29 text

Hashicorp Consul > DNS interface > Supports storing configuration > Consul templates to create configuration files > Product

Slide 30

Slide 30 text

Resilience > Service not available? > Cicuit breaker > Fail fast > Time out > Hystrix > DO NOT IMPLEMENT RESILIENCE YOURSELF!

Slide 31

Slide 31 text

Proxy Load Balancing > Centralized Load Balancing > Can become bottle neck > Single point of failure Load Balancer Server Client

Slide 32

Slide 32 text

Client Ribbon: Client Side Load Balancing > Decentralized Load Balancing > No bottle neck > Resilient > Can consider response time > Data might be inconsistent Load Balancer Server

Slide 33

Slide 33 text

Client Alternative: External Load Balancer > Nginx, Apache httpd… > Probably for each used Microservices > Must each be configured Load Balancer Server

Slide 34

Slide 34 text

REST Service Discovery Resilience Load Balancing Messaging

Slide 35

Slide 35 text

Security > Single Sign on for all Microservices > Each Microservice decides about access policy

Slide 36

Slide 36 text

Client Security Server User / password Token with role Micro- service Request with Token Access / no access

Slide 37

Slide 37 text

Security > JSON Web Token (JWT) > Define standard for tokens > Includes additional data > Can be stored in a cookie

Slide 38

Slide 38 text

Testing

Slide 39

Slide 39 text

Search User Order Process Microservice Continuous Delivery Pipeline Integration Tests … Microservice Continuous Delivery Pipeline Microservice Continuous Delivery Pipeline Production

Slide 40

Slide 40 text

Microservices = Independent Deployment Units

Slide 41

Slide 41 text

No independent testing = no independent deployment

Slide 42

Slide 42 text

Integration Test = Bottleneck

Slide 43

Slide 43 text

Microservice Microservice Request Reply

Slide 44

Slide 44 text

Microservice Stub Request Reply

Slide 45

Slide 45 text

Stubs > Does the calling Microservice work as expected? > Use stubs to replace called Microservice

Slide 46

Slide 46 text

Microservice Microservice Request Reply

Slide 47

Slide 47 text

Consumer- Driven Contract Test Microservice Request Reply

Slide 48

Slide 48 text

Could just use some stub / test tool.

Slide 49

Slide 49 text

Consumer-driven Contract Test > Does the called Microservice work as expected? > Use consumer-driven contract test to replace calling Microservice > Easy to test changes to interfaces

Slide 50

Slide 50 text

Record Microservice Microservice Request Reply

Slide 51

Slide 51 text

Record Consumer- driven contract test Microservice Replay request Validate reply

Slide 52

Slide 52 text

Record Microservice Stub Request Replay reply

Slide 53

Slide 53 text

> Pact https://github.com/realestate-com-au/pact > Pacto https://github.com/thoughtworks/pacto > Wiremock http://wiremock.org/

Slide 54

Slide 54 text

Operations

Slide 55

Slide 55 text

Hold my orange juice while I deploy a Microservice!

Slide 56

Slide 56 text

Deployment Not Easy > Lots of microservices > Lots of stages > Deployment automation mandatory

Slide 57

Slide 57 text

Order Billing Customer Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release Commit Stage Automated Acceptance Testing Automated Capacity Testing Manual Explorative Testing Release

Slide 58

Slide 58 text

Deployment Automation > Deployment automation mandatory > Significant investment > …but worth it!!

Slide 59

Slide 59 text

Docker Images > Easy to build > Dockerfile = shell script > Very efficient > …even for small changes > Unfamiliar to Ops > Replace VMware with Kubernetes?

Slide 60

Slide 60 text

CD Tools > Puppet, Chef etc > Idempotent installation > E.g. easy update > Complex > Idempotent / updates not needed for Docker

Slide 61

Slide 61 text

Linux Packages > Simple format > Centralized installation easy > Unfamiliar to devs

Slide 62

Slide 62 text

Hold my orange juice while I grep the logs for all Microservices!

Slide 63

Slide 63 text

Far too many files on far too many logs!

Slide 64

Slide 64 text

Centralized Logging > Collect all logs on one server > No need for local logs > Read-only file system?

Slide 65

Slide 65 text

ELK Stack > Logstash: JRuby > Inputs, Parser, Outputs > Elasticsearch: Storage, Java > Kibana: Analysis, JavaScript Logfile Logstash Elastic- search Kibana Parse Store Analyze

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

Graylog > Open Source > Elasticsearch for storage > MongoDB for Meta data > GELF format for log messages

Slide 69

Slide 69 text

More Alternatives > Splunk: commercial > +Cloud > Cloud : Loggly > Sumo Logic > Papertrail

Slide 70

Slide 70 text

Hold my orange juice while I do top on my server!

Slide 71

Slide 71 text

Far too many servers!

Slide 72

Slide 72 text

Centralized Metrics > Collect all metrics on one server > Not just operating system, network > …but in particular application

Slide 73

Slide 73 text

Whisper Timeseries DB Graphite Web Carbon Data Library, writes / reads files Analysis Graphite

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

Alternatives > Nagios: Open Source monitoring > Icinga: Originally Nagios fork > Many commercial tools (HP, IBM, CA, BMC) > Riemann: functional programming for event streams > New Relic: Example for cloud

Slide 76

Slide 76 text

Alternatives > TICK stack > InfluxDB: Time-Series Database, also useful for Graphite > Telegraf: Collects data > Chronograf: Visulization > Kapacitor: Alerts, anomaly detection

Slide 77

Slide 77 text

Alternatives > Packetbeat: uses Elasticsearch for storage > …and Kibana for analysis

Slide 78

Slide 78 text

Hold my orange juice while I configure my server!

Slide 79

Slide 79 text

Configuration Files > Easy to create > Servers self- contained > No centralized update possible > Needed with canary releasing?

Slide 80

Slide 80 text

Configuration Server > Easy to push out changes to all servers > Can be the same server as for services discovery > Additional technology

Slide 81

Slide 81 text

> Managing secrets > Lease secrets > Revoke secrets > Key rolling > Audit logs

Slide 82

Slide 82 text

Microservice Frameworks > Lots and lots of them > Each Microservice might use a different > Not too much influence on the overall system

Slide 83

Slide 83 text

> Deployment Automation > Centralized Logging & Monitoring > Configuration > Messaging or > REST + Service Discovery + Reslience + Load Balancing > Stubs & Consumer-driven Contract tests Operations Communication Testing

Slide 84

Slide 84 text

So much stuff!

Slide 85

Slide 85 text

Technologies solve problems.

Slide 86

Slide 86 text

Use a technology only if it solves a problem.

Slide 87

Slide 87 text

> Deployment automation is great! > Maybe Microservices finally enforce deployment automatiom? > Operation & testing requires additional effort > Communication: No DNS? No Messaging? Operations Communication Testing

Slide 88

Slide 88 text

Microservices are a trade-off!

Slide 89

Slide 89 text

Microservices create additional technical complexity!