75
Microservices Architecture Nirvana or Nightmare?

Microservices Architecture: Nirvana or Nightmare

Embed Size (px)

Citation preview

Microservices ArchitectureNirvana or Nightmare?

ilegra

SOA Services in 5 minutes

Just another flavor of SOA

SOA isn’t Web Services

Contract Versioning

Service Design

Microservices isn’t always the best architecture

Not everybody likes Microservices

Small company

Disruptive Values

Doesn’t really match most of companies

Microservices Architecture is primarily to scale people

Scaling people without architecture

In my previous project

Issues

➔ Teams depending from other teams to release

➔ Feature synchronization overhead

➔ Creating stubs to parallelize development

➔ Release synchronization overhead

➔ Impossible to experiment

➔ Very little innovation

Scaling Teams

Benefits

➔ Teams are independant

➔ Parallel development and releases

➔ Small teams tend to iterate faster

➔ Easy to experiment

Ownership

Handoff

Client

(Business)

Business

Analyst

Developer QA / Tester Ops

When there is a problem, this is no one baby

Logs written by dev and read by Ops

More services, more problems

Escalation process

TI doesn’t

deliver

Business

Developers

create unstable

software

Operation

Operation is too

slow

Developer

Management 3.0

You code it, You run it!

Data Architecture

Problem

Potential solution: Product service call other services

● Simple

● Concurrency issue

● Single Responsability

Principle Issue

● Inconsistency issue

Potential solution: Broker

● Single Responsibility

Principle

● Inconsistency

● Concurrency

● Contract issue

● Performance issue

Potential solution: Writes via Message Bus

● Single Responsibility Principle

● Inconsistency

● Concurrency

● Contract

● Complexity

CQRS

Shared mutable state ....

Base of Data Architecture == Functional Principles

Immutable Data

Structure

Pure Functions

Eventual Consistency

Operation Overhead

Operability

12 Factors➔ One codebase tracked in

revision control, many deploys

➔ Explicitly declare and isolate

dependencies

➔ Store config in the

environment

➔ Treat backing services as

attached resources

➔ Strictly separate build and run

stages

➔ Execute the app as one or

more stateless processes

➔ Export services via port

binding

➔ Export services via port

binding

➔ Scale out via the process

model

➔ Maximize robustness with fast

startup and graceful shutdown

➔ Keep development, staging,

and production as similar as

possible

➔ Treat logs as event streams

➔ Run admin/management tasks

as one-off processes

Normalization

UI - Service - Data skeleton

Web Server

Services Configuration

Archaius

Spring-Cloud

Services Discovery

Eureka

Mesos DNS

Services calls

Edge Service

Logs

Parser

Log files

Dashboard

Indexer

Monitoring / Tracing

Deploy

Immutable Infrastructure

Platform as a Service

Anti-Fragile

High number of moving part

High number of moving part

Difference between Error and Failure

Impact of a server going down or getting slow?

Impact of a switch going down?

Impact of a datacenter going down?

Impact on the customer?

Failure protection

Failover Strategy

No impact on developers?

Agile Coaching

XP isn’t enough! But is a good start :)

Each service needs it own architecture

Developers need to test more stuff

➔ Unit tests

➔ Functional tests

➔ Contract tests

➔ Backward compatibility tests

➔ Forward compatibility tests

➔ Stress tests

➔ Chaos tests

Incident Drills

Learning and Teaching Culture

Existing Stacks

Microservice Architecture

Summary➔ Architecture to scale Teams

➔ Highly Flexible

➔ Highly complex

➔ Ownership using Management 3.0

➔ Development Mastering using Agile Coaching

➔ Agile deploy thanks to a Platform as a Service

➔ Data Architecture

➔ DevOps