Accion Labs Microservices Whitepaper

26
Microservices White Paper

Transcript of Accion Labs Microservices Whitepaper

Page 1: Accion Labs Microservices Whitepaper

MicroservicesWhite Paper

Page 2: Accion Labs Microservices Whitepaper

Agenda

● Evolution of application infrastructure

● Web application architecture models

● What is a microservice?

● How are microservices utilized?

● A case study

Page 3: Accion Labs Microservices Whitepaper

Evolution of application infrastructure

Page 4: Accion Labs Microservices Whitepaper

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

Page 5: Accion Labs Microservices Whitepaper

Web application architecture models

Page 6: Accion Labs Microservices Whitepaper

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

Page 7: Accion Labs Microservices Whitepaper

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

Page 8: Accion Labs Microservices Whitepaper

● 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

Page 9: Accion Labs Microservices Whitepaper

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

Page 10: Accion Labs Microservices Whitepaper

● 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

Page 11: Accion Labs Microservices Whitepaper

What is a Microservice?

Page 12: Accion Labs Microservices Whitepaper

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

Page 13: Accion Labs Microservices Whitepaper

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

Page 14: Accion Labs Microservices Whitepaper

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

Page 15: Accion Labs Microservices Whitepaper

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

Page 16: Accion Labs Microservices Whitepaper

How are MicroservicesUtilized?

Page 17: Accion Labs Microservices Whitepaper

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

Page 18: Accion Labs Microservices Whitepaper

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

Page 19: Accion Labs Microservices Whitepaper

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

Page 20: Accion Labs Microservices Whitepaper

Case Study:Patent Research Platform

Page 21: Accion Labs Microservices Whitepaper

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

Page 22: Accion Labs Microservices Whitepaper

Legacy Application Performance

Page 23: Accion Labs Microservices Whitepaper

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

Page 24: Accion Labs Microservices Whitepaper

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

Page 25: Accion Labs Microservices Whitepaper

Reengineered Performance

Page 26: Accion Labs Microservices Whitepaper

Thanks!

http://accionlabs.com

Tony [email protected]