Accion labs microservices white paper

Post on 12-Apr-2017

16 views 0 download

transcript

MicroservicesWhite Paper

Agenda

● Evolution of application infrastructure

● Web application architecture models

● What is a microservice?

● How are microservices utilized?

● A case study

Evolution of application infrastructure

Mainframe PCs & Servers

Web Cloud

App

UI

DB

Monolithic

Client

Server

UI

DB

Client Server

App

UI

DB

N-Tier

UI

AppDB

AppDB

AppDB

AppDB

AppDB

AppDB

Service Oriented

Infr

astr

uct

ure

Ap

pli

cati

ons

Web application architecture models

Monolithic● Tightly coupled

components

● Large codebase

● Difficult tochange

● Long releasecycles

● Waterfall development

Highly sensitive to errors

Normalized data models

Single technology stack

Large development teams

Expensive to scale infrastructure

Architecture

Application

Web Browser

Users Manager Products Manager

Inventory Manager Orders Manager

Users Products

Inventory Orders

Components Libraries of reusable code

Inter-component communication

In-process calls

Orchestration Application Logic

Interface Definitions Code documentation

Technology Stack Single application platform

Persistence, Data Management, Data Models, Consistency

Centralized Persistence, Single Database, Unified Data Model, Transactional Consistency

● Tightly coupled services

● Partitionedcodebase

● Easier tochange

● Shorter releasecycles

● Iterative development

Less sensitive to errors

Normalized data models

Single technology stack

Several smallerdevelopment teams

Cheaper to scale infrastructure

Service Oriented Architecture

Web App

Users Products

Inventory Orders

Components Independently deployed services

Inter-component communication

Tightly coupled Messages

Orchestration Service Bus

Interface Definitions Discoverable, provider contracts

Technology Stack Disparate application platforms

Persistence, Data Management, Data Models, Consistency

Centralized Persistence, Single Database, Unified Data Model, Transactional Consistency

Users Manager

ProductsManager

InventoryManager

OrdersManager

Service Bus

● Loosely coupled services

● Small codebase per service

● Built for change

● Short release cycles

● Iterative development

Resilient to errors

Denormalized data model

Multiple technology stacks

Several small development teams

Cheaper to scale infrastructure

●●

Microservices Architecture

What is a Microservice?

Small Service

● Provides one or more RESTful API endpoints

● All APIs are related to a single functional domain or entity

● APIs generalized for covering maximum use cases

● Code size small enough for a single SCRUM team to own and manage

Users Manager

ProductsManager

InventoryManager

OrdersManager

Independent Service

● Functional Independence: Not dependant on any other microservice

● Data Independence: Owns its data entities

● Technology Independence: Uses tech stack that is best suited

● Denormalized: Keeps a copy of all data required for its functioning

Users Manager

ProductsManager

InventoryManager

OrdersManager

Users DB Products DB Inventory DB Orders DB

Event Aware Service

● Publishes all significant events that occur in its domain or entity

● Subscribes to all dependent events that affect its domain or entities

● Able to regenerate all its data by replaying past events

UsersManager

ProductsManager

InventoryManager

OrdersManager

Users DB Products DB Inventory DB Orders DB

Events Store/Queue

Extensible, Expendable Service

● Multiple instances of the same service can coexist

● New version of a service can be tested along with an old version

● Other services are not affected by changes in one service

Events Store/Queue

Users Managerver 1.1

Users DBver 1.1

UsersManagerver 1.0

Users DBver 1.0

InventoryManager

Inventory DB

OrdersManager

Orders DB

ProductsManager

Products DB

How are MicroservicesUtilized?

Responsive UI Applications

Web UI App Mobile UI App

Generalized APIs

UsersManager

ProductsManager

InventoryManager

OrdersManager

Users DB Products DB Inventory DB Orders DB

Events Store/Queue

API GatewayWeb UI App Mobile UI App

Generalized APIs

Users Manager

ProductsManager

InventoryManager

OrdersManager

Users DB Products DB Inventory DB Orders DB

Events Store/Queue

API Gateway

UI Optimized APIs

Monolithic Architecture Service Oriented Architecture Microservices Architecture

Components Libraries of reusable code Independently deployed services

Services of reusable applications

Inter-component communication

In-process calls Tightly coupled Messages Publish-Subscribe Events

Orchestration Application Logic Service Bus Event Queue

Interface Definitions Code documentation Discoverable, provider contracts Discoverable, consumer-driven contracts

Technology Stack Single application platform Disparate application platforms Independent applications

Persistence, Data Management, Data Models, Consistency

Centralized Persistence, Single Database, Unified Data Model, Transactional Consistency

Centralized Persistence, Single Database, Unified Data Model, Transactional Consistency

Polyglot Persistence, Multiple Databases, Domain-driven Bounded Contexts, Eventual Consistency

Comparison Chart

Case Study:Patent Research Platform

Patent Research Application

Dashboards

Users Manager

Customers Manager

Workflow Manager

Collaboration Engine

Users Customers

Intranet Customer Portal

AdminPanel

Projects Manager

DocumentsManager

Search Engine

Analytics Engine

Projects Documents

Workflows Discussions FTS Index Analytics Data

Legacy Architecture

Legacy Application Performance

Reengineered Architecture

Workflow Manager

Workflows DB

Collaboration Engine

Discussions DB

Full Text Search Engine

Search DB

Analytics Engine

Analytics DB

Users Manager

Users DB

Customers Manager

Customers DB

Projects Manager

Projects DB

Documents Manager

Documents DB

Events Store/Queue

API Gateway

Dashboards Intranet Customer Portal AdminPanel

Technology Stack

Workflow Manager

MongoDB

Collaboration Engine

MongoDB

Full Text Search Engine

Elastic Search

Analytics Engine

Cassandra

Users Manager

MariaDB

Customers Manager

MariaDB

Projects Manager

MariaDB

Documents Manager

MongoDB

Apache Kafka

NodeJS

HTML5, CSS, JS Bootstrap AngularJS D3JS

Am

azon

Web

Ser

vice

s

Reengineered Performance

Thanks!

http://accionlabs.com

Tony Kernanakernan@accionlabs.com