microservices: architecture for the real-time organization

83
Microservices: Architecture for the Real-time Organization

Upload: kevin-webber

Post on 16-Apr-2017

1.510 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Microservices: Architecture for the Real-time Organization

Microservices: Architecture for the Real-time Organization

Page 2: Microservices: Architecture for the Real-time Organization

Why microservices?

Page 3: Microservices: Architecture for the Real-time Organization
Page 4: Microservices: Architecture for the Real-time Organization
Page 5: Microservices: Architecture for the Real-time Organization
Page 6: Microservices: Architecture for the Real-time Organization
Page 7: Microservices: Architecture for the Real-time Organization
Page 8: Microservices: Architecture for the Real-time Organization
Page 9: Microservices: Architecture for the Real-time Organization
Page 10: Microservices: Architecture for the Real-time Organization
Page 11: Microservices: Architecture for the Real-time Organization
Page 12: Microservices: Architecture for the Real-time Organization
Page 13: Microservices: Architecture for the Real-time Organization

heritage architecture» Single points of failure

» Impossible to scale out (shared mutable state, etc)

» Different non-functional requirements (reads, writes, compute)

» Optimized for none!

» Long, risky release cycles

Page 14: Microservices: Architecture for the Real-time Organization

What are microservices?

Page 15: Microservices: Architecture for the Real-time Organization
Page 16: Microservices: Architecture for the Real-time Organization
Page 17: Microservices: Architecture for the Real-time Organization
Page 18: Microservices: Architecture for the Real-time Organization
Page 19: Microservices: Architecture for the Real-time Organization
Page 20: Microservices: Architecture for the Real-time Organization
Page 21: Microservices: Architecture for the Real-time Organization
Page 22: Microservices: Architecture for the Real-time Organization
Page 23: Microservices: Architecture for the Real-time Organization
Page 24: Microservices: Architecture for the Real-time Organization
Page 25: Microservices: Architecture for the Real-time Organization

Microservices» Ubiquitous language

» Well defined models & boundaries

» Single responsibility

» Independantly deployable, scalable, resilient

» Communicate via async messaging

» Own their data

» Don't expose a public API

Page 26: Microservices: Architecture for the Real-time Organization

Approach?Principles

» responsive, resilient, elastic, message-driven

Page 27: Microservices: Architecture for the Real-time Organization

Approach?Principles

» responsive, resilient, elastic, message-driven

Concepts

» bounded contexts (DDD), event sourcing, CQRS, CAP (eventual consistency)

Page 28: Microservices: Architecture for the Real-time Organization

Approach?Principles

» responsive, resilient, elastic, message-driven

Concepts

» bounded contexts (DDD), event sourcing, CQRS, CAP (eventual consistency)

Tools

» Typesafe Reactive Platform (Play, Akka, Spark)

Page 29: Microservices: Architecture for the Real-time Organization

Concepts and patternsWe will cover:

» Domain Driven Design (DDD)

» Async messaging

» API management

» Dependency management

» CQRS & event sourcing

» Transactions & ordering

Page 30: Microservices: Architecture for the Real-time Organization

Domain Driven Design

Page 31: Microservices: Architecture for the Real-time Organization
Page 32: Microservices: Architecture for the Real-time Organization
Page 33: Microservices: Architecture for the Real-time Organization
Page 34: Microservices: Architecture for the Real-time Organization
Page 35: Microservices: Architecture for the Real-time Organization
Page 36: Microservices: Architecture for the Real-time Organization

Going async

Page 37: Microservices: Architecture for the Real-time Organization
Page 38: Microservices: Architecture for the Real-time Organization
Page 39: Microservices: Architecture for the Real-time Organization
Page 40: Microservices: Architecture for the Real-time Organization
Page 41: Microservices: Architecture for the Real-time Organization

Async Benefits» Not wasting resources

» Memory, CPU, threads

» Embracing failure

» Not expecting a return from a remote service

» Designing for all scenarios

Page 42: Microservices: Architecture for the Real-time Organization

Akka Actors» Message driven architecture

» Distribution

» Location transparency

» Isolation

Page 43: Microservices: Architecture for the Real-time Organization

API management

Page 44: Microservices: Architecture for the Real-time Organization
Page 45: Microservices: Architecture for the Real-time Organization
Page 46: Microservices: Architecture for the Real-time Organization
Page 47: Microservices: Architecture for the Real-time Organization
Page 48: Microservices: Architecture for the Real-time Organization
Page 49: Microservices: Architecture for the Real-time Organization
Page 50: Microservices: Architecture for the Real-time Organization
Page 51: Microservices: Architecture for the Real-time Organization
Page 52: Microservices: Architecture for the Real-time Organization
Page 53: Microservices: Architecture for the Real-time Organization
Page 54: Microservices: Architecture for the Real-time Organization
Page 55: Microservices: Architecture for the Real-time Organization

API mgmt.» Messaging patterns

» Pub/sub, point-to-point, streaming

» API gateway

» Routing, aggregation, protocol translation

» Discovery

» Service discovery, registry, versioning

Page 56: Microservices: Architecture for the Real-time Organization

Dependency management

Page 57: Microservices: Architecture for the Real-time Organization
Page 58: Microservices: Architecture for the Real-time Organization
Page 59: Microservices: Architecture for the Real-time Organization
Page 60: Microservices: Architecture for the Real-time Organization
Page 61: Microservices: Architecture for the Real-time Organization
Page 62: Microservices: Architecture for the Real-time Organization
Page 63: Microservices: Architecture for the Real-time Organization

CQRS & event sourcing

Page 64: Microservices: Architecture for the Real-time Organization
Page 65: Microservices: Architecture for the Real-time Organization
Page 66: Microservices: Architecture for the Real-time Organization
Page 67: Microservices: Architecture for the Real-time Organization
Page 68: Microservices: Architecture for the Real-time Organization
Page 69: Microservices: Architecture for the Real-time Organization
Page 70: Microservices: Architecture for the Real-time Organization
Page 71: Microservices: Architecture for the Real-time Organization
Page 72: Microservices: Architecture for the Real-time Organization

Transactions and ordering

Page 73: Microservices: Architecture for the Real-time Organization

Considerations» ACID doesn't work across location/trust boundaries

» No 2-Phase commits (2PC)

» No holding locks for the duration of work

» In distributed systems we need to compensate for for failure rather than prevent failure

Page 74: Microservices: Architecture for the Real-time Organization
Page 75: Microservices: Architecture for the Real-time Organization
Page 76: Microservices: Architecture for the Real-time Organization

What next?

Page 77: Microservices: Architecture for the Real-time Organization
Page 78: Microservices: Architecture for the Real-time Organization
Page 79: Microservices: Architecture for the Real-time Organization
Page 80: Microservices: Architecture for the Real-time Organization
Page 81: Microservices: Architecture for the Real-time Organization
Page 82: Microservices: Architecture for the Real-time Organization

Microservices with Typesafe» Play for API gateway

» Akka for core microservices (DDD, CQRS, event sourcing)

» ConductR for cluster management (service registry, discovery, architecture visualization, security)

Page 83: Microservices: Architecture for the Real-time Organization

Thank you!Visit https://www.typesafe.com/products/typesafe-reactive-platform to get started

Contact info

» Twitter: @kvnwbbr

» Email: [email protected]