Adopting Microservices - Around25

Post on 22-Jan-2017

226 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

Transcript

Adopting Microservices

Cosmin Harangus

Technical Director @ Around25

7 May 2016, Cluj Napoca

Microservices are small, autonomous services that work

together.

E-learning Platform

- Video conference

- Present materials

- Multiple users

- Teacher area

- Upload materials

- Create classes

- Assign and Review Homework

- Student area

- See and join classes

- Complete homework

- Administrative area

- Manage users

- Manage materials

- Handle Invoices

- View Payments

Common Architecture

Advantages

- Simple to setup

- Easy to add features very fast

- Easy to follow and debug

- DRY

- Simple to deploy

Disadvantages

- Becomes very large due to the complexity of the business domain

- Hard to keep boundaries between domains

- Hard to scale efficiently

- Unable to take advantage of new technologies

- Complex database with many interconnected tables

How can we improve?

Break into smaller parts

Immediate Benefits

- Single responsibility

- Comprehensible size for each service

- A clear, language agnostic API for each service

- Technology diversity

- Easy to scale specific parts

Extra Complexity

- Additional git repositories to manage

- More complex deployment

- Dealing with failures

What else?

Identify Bottlenecks!Database / Servers / Services

Separate Databases

Separated Databases

Distributed Services

Distributed Services

Is HTTP the only way?

Communication

HTTP is a popular transport in microservices:

- RESTful APIs using JSON data

- DNS, Load balancing, Request/Reply

- Easy to understand

Better alternatives available for:

- Asynchronous communication

- Faster transport

- Better communication patterns

Message Queue Server

MQ Benefits

- Asynchronous communication

- No endpoint dependency

- Works if endpoint is down temporarily

Communication patterns - Load balancing

Communication patterns - Publish / Subscribe

Communication patterns - RPC

Further improvements?

Further improvements

- How does failure impact our users?

- How can we keep our system responsive to failure and auto restart servers and services?

- How can we see the general state of our system?

- How can we centralize all logs in order to get insights into our users and our system?

Welcome to the world of microservices!

For more details visit us @ around25.com

top related