Sie sind auf Seite 1von 23

Microservices Architecture

Introduction

Rag Dhiman
ragcode.com | @RagDhiman
Course Overview

Microservice

First Module Second Module


Introduction Design Approach

VM VM

VM

Host

Third Module Fourth Module


Technology Moving Forwards
Module Overview

Microservices
Emergence of Microservices
Microservices Design Principles
Microservices
What is a Service? | Introduction | The Monolithic
Microservices: What is a Service?
Account Orders

Offers Basket

Shopping
Website website

Account
Service Database

Mobile App

Desktop App

Network
Microservices: What is a Service?
Account Orders

Offers Basket

Website
Server 1

Account
Load
Balancer
Mobile App
Database
Server 2
Server

Server 3

Desktop App

Network
Microservices: Introduction
SOA done well

Knowing how to size a service


Traditional SOA resulted in monolithic services


Micro sized services provide


Service
UI Eciently scalable applications

Service Flexible applications


Client High performance applications


Application(s) powered by multiple services


Small service with a single focus


Service
Lightweight communication mechanism

Both client to service and service to service


Technology agnostic API


Independent data storage


Service Independently changeable


Independently deployable

Distributed transactions

Centralized tooling for management



Microservices: Introduction

Accounts
Shopping Service
website

Promotions
Service

Orders
Account Orders
Service

Internal
Support Inventory
Offers Basket website Service

Products
Service
Client

API
Internet
Gateway
Microservices
What is a Service? | Introduction | The Monolithic
Microservices: The Monolithic
Typical enterprise application

No restriction on size

Large codebase

Accounts Longer development times


Shopping Challenging deployment


Account Orders

website
Orders
Inaccessible features

Offers Basket
Fixed technology stack

Data Database
Service Promotions
Access High levels of coupling

Customer
Between modules

Inventory
Internal Between services

Support
website Failure could aect whole system

Products
Scaling requires duplication of the whole

Single service on server


Internet
Minor change could result in complete rebuild

Easy to replicate environment



Microservices: The Monolithic

Accounts

Account Orders

Orders
Offers Basket

Shopping Data Database


Promotions
Customer website Access

Inventory

Products

Internet UI Business Data


Layer Layer Layer
Emergence of Microservices
Why Now? | Benefits
Emergence of Microservices : Why Now?

Need to respond to change quickly


Need for reliability


Shopping
Accounts
Service

Business domain-driven design


website

Promotions

Automated test tools


Service

Release and deployment tools


Orders
Service
Account Orders

On-demand hosting technology


Internal
Support Inventory
Offers Basket website Service

On-line cloud services


Products

Need to embrace new technology


Service
Client

Asynchronous communication technology


API
Internet
Gateway

Simpler server side and client side technology


Emergence of Microservices : Benefits

Shorter development times


Reliable and faster deployment

Accounts

Enables frequent updates


Shopping Service
website

Decouple the changeable parts


Promotions
Service

Security
Orders
Service

Increased uptime
Account Orders
Internal
Support Inventory

Fast issue resolution


Offers Basket website Service

Highly scalable and better performance


Products
Service
Client

Better ownership and knowledge


Internet
API

Right technology
Gateway

Enables distributed teams


Microservices Design Principles
Introduction | Principles | Summary
Microservices Design Principles: Introduction

Business Domain
High Cohesion Autonomous
Centric

Resilience Observable Automation


Microservices Design Principles: High Cohesion

Single focus
Accounts

Single responsibility
Service

SOLID principle

Only change for one reason


Postage
Service

Reason represents

A business function
Orders

A business domain
Service

Encapsulation principle

OOP principle
Stock
Service

Easily rewritable code


Products

Why
Service

Scalability

Flexibility

Reliability
Microservices Design Principles: Autonomous
Loose coupling

Accounts
Service Honor contracts and interfaces

V1

Postage Stateless

Service
V6 Independently changeable
Orders
Service
V3
Independently deployable
Stock Backwards compatible
Service
V4
Concurrent development
Products
Service
V2
Design Principles: Business Domain Centric
Service represents business function

Accounts

Accounts Department
Service

Postage calculator
Accounts Department
Scope of service

Orders
Bounded context from DDD

Service
Orders Department Identify boundaries\seams

Shue code if required


Products

Group related code into a service


Service
Stock Department

Aim for high cohesion


Responsive to business change

Microservices Design Principles: Resilience
Embrace failure

Another service

Specific connection
Accounts

Third-party system
Service

! Degrade functionality

Default functionality
Postage

Service Multiple instances


Register on startup

Orders Deregister on failure


Service Types of failure


Exceptions\Errors

Delays
Stock

Unavailability
Service

Network issues

Products Delay

Service Unavailability

Validate input

Service to service

Client to service

Microservices Design Principles: Observable
System Health

Status

Logs

Central
Monitoring Errors

Centralized monitoring

Centralized logging

Why

Distributed transactions

Quick problem solving


Quick deployment requires feedback


Data used for capacity planning


Data used for scaling


Central
Logging
Whats actually used

Monitor business data



Microservices Design Principles: Automation
Tools to reduce testing

Manual regression testing


Time taken on testing integration


Environment setup for testing

Tools to provide quick feedback


Integration feedback on check in


Continous Integration
X

Tools to provide quick deployment

Pipeline to deployment

Deployment ready status


Automated deployment

Reliable deployment

Continuous Deployment
Why


Distributed system
Multiple instances of services

Manual integration testing too time consuming


Manual deployment time consuming and unreliable


Module Summary
Microservices

Service

Introduction

The Monolithic
Emergence of Microservices

Why Now?

Benefits
Microservices Design Principles
High Cohesion

Autonomous

Business Domain Centric


Resilience

Observable

Automation

Das könnte Ihnen auch gefallen