Top Banner
@ITCAMPRO #ITCAMP16 Community Conference for IT Professionals Azure Microservices in Practice Radu Vunvulea Solution Architect, iQuest Technologies Microsoft Azure MVP @RaduVunvulea
55

Azure Microservices in Practice - Radu Vunvulea

Jan 07, 2017

Download

Technology

ITCamp
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Azure Microservices in Practice

Radu Vunvulea

Solution Architect, iQuest Technologies

Microsoft Azure MVP

@RaduVunvulea

Page 2: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 3: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Many thanks to our sponsors & partners!

GOLD

SILVER

PARTNERS

PLATINUM

POWERED BY

Page 4: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

RADU VUNVULEA MCTS MCP BANK HOME AUTOMATION

MVP ENTERPRISE

AUTOMOTIVE PHARMA

LEAN AND AGILE E-COMMERCE

WEB iQuest

AZURE JAVASCRIPT VUNVULEARADU.BLOGSPOT.COM

MOBILE DOTNET @RaduVunvulea

WCF WPF ENTHUSIASTIC

Page 5: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Scope

Page 6: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

WHAT ARE MICROSERVICES?

Page 7: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 8: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Software architecture style in which complex

applications are composed of small, independent

processes communicating with each other using

language-agnostic APIs

Microservices

Page 9: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

WHY WE SHOULD USE

MICROSERVICES?

Page 10: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

If we need a system that has components that are…

High decoupled

Small

Easy to replace

Focus on doing a small task

Independent deployment units

Symmetrical architecture

Page 11: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Evolution

Maintenance

is hard

Adding new

features is slow

Changes are

expensive

Technology

becomes the

obstacle rather

than enabler

App Modernization

Page 12: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

(AZURE) SERVICE FABRIC

Page 13: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Service Fabric

• Azure Service Fabric

Why we have two different things?

?

Page 14: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Service Fabric | Azure Service Fabric

Microservices

Cloud

AzureAzure Service

Fabric

AWS Service Fabric

On-premises Service Fabric

Page 15: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Overview

Service Fabric

Azure

Windows Server

Linux

On-premises

Windows Server

Linux

Hosted clouds

Windows Server

Linux

Microservice

Microservice

Microservice

Microservice

Microservice

Page 16: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

SERVICE TYPE

Page 17: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Rel

iab

le S

ervi

ce • Classical service

• Reliable

• Available

• Scalable

Act

or • State

• Turn-base access

• Single thread

• Reentrancy

Page 18: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Stat

eles

s •No state persisted between calls

Stat

efu

l

•‘A’ state is persisted between calls

Page 19: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 20: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

What can we run in Service Fabric?

Service Fabric

Web Sites

Application

Custom logic

Page 21: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Multiple programing languages (C# & Java)

• Support different commucation mechanisms:

–HTTP(s)

–WCF

–TCP

–UDP

• Any protocol and communication stack is supported

• Capable to run a guest executable

How

Page 22: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 23: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

SERVICE LIFECYCLE

Page 24: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Reliable

Services Actors

Stateful

Stateless

State

StateState

First call…

Reliable Collections

Page 25: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Reliable

Services Actors

Stateful

Stateless

State

State

… after the call is executed

State

Page 26: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Reliable

Services Actors

Stateful

Stateless

State

State

… when GC is triggered

State

Page 27: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 28: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

One UI for all environments

Page 29: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

DEBUGGING AND TRACING

Page 30: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Local debugging like any other .NET application

• Attach debugger to any Service Fabric Application

(on-premises or cloud)

• Diagnostic Events persistent in Cluster

• Real time Streaming Traces (Diagnostics Events)

Debugging and tracing

Page 31: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 32: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Low latency

• High-throughput

• Transactional

• Can be used only

with Reliable Services

Reliable Collections

Dictionary

and

Queue

Replicated

Persisted

In-memory <<servic

e instance

>>

Asynchronous

Transactional

Page 33: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Where collection are stored

Page 34: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Different instances of the same

service can access the same

Reliable Collection

• Instances from different

services cannot access the

same collection

Reliable Collection – visibility

Page 35: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 36: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

TIMERS AND REMINDERS

Page 37: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Timers and Reminders

Timers

Similar with .NET

Called at a specific time interval

Reminders

Timer with persistence

Trigered in all circumstances (deactivations and failovers)

Concurrency

Turn based concurrency

Stateful Actos only

Page 38: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• Context: Multiple calls to the same Reliable Actor

Concurrency

Page 39: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Concurrency

Page 40: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Concurrency

Page 41: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Execution flow:

• Reminder Trigger

• SetPrice

• SetStock

Concurrency

Page 42: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 43: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Events

• Send events and

notifications from

services to caller

• Allows us be notified at

different steps on when

an exception occurs

• Can be used only for

actor-client

communication

Page 44: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

• On Actor:

– IActorEvents

– Trigger our custom events

• On source:

– Implement callback (Event Handler)

– Subscribe our Event Handler

Events

Page 45: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 46: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

TRACING AND DEBUGING

Page 47: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

BEHIND THE SCENE

Page 48: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Partition and Replication

Page 49: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Fault Domains and Upgrade Domains

Page 50: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Where we can control them

Application

• Partitioning

• Replication

Cluster

• Fault Domain

• Upgrade Domain

• Naming Service

• Resource Balancer

• Failover Manager

Page 51: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Page 52: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Question

Answers

Page 53: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

{“name” : “Radu Vunvulea,“blog” : “vunvulearadu.blogspot.com”,

“email” : ”[email protected]”,“socialMedia” :

{“twitter” : “@RaduVunvulea”,“fb” : “radu.vunvulea”

}

}

Page 54: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

Today: Enjoy ITCamp Day 1Tomorow: Enjoy ITCamp Day 2

Saturday: Take a look on https://github.com/Azure/servicefabric-samples

Page 55: Azure Microservices in Practice - Radu Vunvulea

@ITCAMPRO #ITCAMP16Community Conference for IT Professionals

{“name” : “Radu Vunvulea,“blog” : “vunvulearadu.blogspot.com”,

“email” : ”[email protected]”,“socialMedia” :

{“twitter” : “@RaduVunvulea”,“fb” : “radu.vunvulea”

}

}