Top Banner
Template designed by Sviluppare e gestire architetture a microservizi su Azure Vito Flavio Lorusso [email protected] - @vflorusso https://github.com/vflorusso /
30

SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Aug 17, 2015

Download

Education

DotNetCampus
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: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Template designed by

Sviluppare e gestire architetture a microservizi su Azure

Vito Flavio [email protected] - @vflorussohttps://github.com/vflorusso/

Page 2: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Chi sono e cosa faccio

Page 3: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Obiettivi e takeaway

Architetture

Cloud

Stato della

tecnologia

Azure

Docker

Service

Fabric

Page 4: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Un po’ di contesto

80s 90s 2000s oggi

Architetture

Computing style

Ciclo di vita

PC o Mainframe Desktop e browser Web e smart client Mobile, web, desktop

«fat client»«fat server»

Client - Server SOA Distribuite

Waterfall Waterfall + Agile Agile + ScrumScrum + LeanContinuous delivery

Page 5: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Ieri

Le sfide

Oggi

Uno store dati

Un sistema operativo prevalente

Un client

Una tecnologia di sviluppo

ER, NoSQL, Hadoop

Windows + Linux

Mobile, Web, TV

.NET, Javascript, NodeJS, Xamarin, Java

Page 6: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Abbiamo bisogno di un nuovo stile di architettura

Page 7: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

L’evoluzione dell’architettura software

Desktop

Client

Server

Browser

Web Server

Db Server

Any Device

microservices

API Proxy

Page 8: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Cosa è un «Microservice»

• Funzionalità specializzata• «loosely coupled» da altre funzionalità“Autonomo”

• Sviluppato, testato e aggiornato autonomamente“Isolato”

• Può avere o non avere stato• scalare in maniera indipendente“Elastico”

• “fault tolerant”• altamente disponibile“Resiliente”

• Risponde in tempi rapidi e “predicibili”“Responsivo”

Page 9: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Architettura logica

Microservice

• “Any client” UX

• SDK per accedere al servizioSDK

• Protocollo di comunicazione standard (in genere REST/HTTP)

Protocol

• Modelli datiModels

• Logia e regole di businessService

• Strato di accesso ai datiDAC

• Store di dati persistenteStore

• “Continuous Delivery”Automation

Protocol

Protocol

DAC

Store

Any Client

Models

Service

SDK

Auto

mati

on

Page 10: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Le soluzioni disponibili su Azure

VMs and VM Scale Sets

Azure Public CloudAzure-Consistent Private Cloud

VM Extensions

SCALR, RightScale, Mesos, Swarm

Service Fabric (VMs and Containers)

BatchApp Service

MediaWeb Apps

MobileApps

Apprenda, CloudFoundryJelastic, Marathon

Infrastructure

IaaS and IaaS+

General Compute

PaaS

Vertical compute

PaaS

Cluster Orchestratio

n

Page 11: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker: VM vs Container

AppA

Hypervisor (Type 2)

Host OS

Server

GuestOS

Bins/Libs

AppA’

GuestOS

Bins/Libs

AppB

GuestOS

Bins/Libs

VM

GuestOS

GuestOS

App A’Host OS

Server

Bins/Libs

App A

Bins/LibsApp B

App B’

App B’

App B’Container

I Container sono isolati,ma condividono il kernel del sistema operativo e i binari/librerie

Docker Engine

Picture Source: www.docker.com

Portabilità, agilità e cost-saving

Page 12: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker: portabilità dei container

Page 13: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker: Ecosistema

Docker Host

Docker Client

Docker Hub

Container A

Container B

…Source Code Repo

Create

Delete

List

Push

Pull

Private Repositories

Private Repositories

Page 14: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker: continuous integration

Container«app»

Container«cache»

Container«data»

Docker Host #1 Docker Host #2 Docker Host #3

Applicazione

Ambiente di runtime

a c dc a d d d d d c c

Page 15: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker: continuous integration (contd.)

Container«app»

Container«cache»

Container«data»

Docker Host #1 Docker Host #2 Docker Host #3

Applicazione

Ambiente di runtime

a c dc a d d d d d c c

Machine

Compose

Swarm

Page 16: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Docker Compose: YAML filewordpress.ymlname: counterwordpress: image: wordpress links: - mysql ports: - "80:80" environment: - WORDPRESS_DB_NAME=wordpress - WORDPRESS_DB_USER=wordpress - WORDPRESS_DB_PASSWORD=wordpresspwd mysql: image: mysql volumes: - /home/docker/mysql:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=wordpressdocker - MYSQL_DATABASE=wordpress - MYSQL_USER=wordpress - MYSQL_PASSWORD=wordpresspwd

group.ymlname: countercontainers:

web:build: .command: python app.pyports:- "5000:5000"volumes:- .:/codelinks:- redis

redis:image: redis:latest

Page 17: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Azure PaaS – App Service / Data Stores

Doc DB

Web App

Azure CacheSQL DB

Microservice A

API App

Microservice B

Batch

Page 18: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Azure PaaS – Continuous Deployment

Doc DB

Web App

Azure CacheSQL DB

Microservice A

API App

Microservice B

Batch

RESOURCE GROUP

Azure Resource Manager

json json

Page 19: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Esempi di file JSON

https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/

Page 20: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Esempi di file JSON

https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/

Page 21: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Esempi di file JSON

https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/

Page 22: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Service Fabric

Azure

WindowsServer Linux

Hosted Clouds

WindowsServer Linux

Service Fabric

Private Clouds

WindowsServer Linux

High Availability

Hyper-Scale

Hybrid Operations

High Density

Microservices

Rolling Upgrades Stateful

services

Low LatencyFast startup & shutdown

Container Orchestration & lifecycle management Replication &

Failover

Simple programming models

Load balancing

Self-healingData Partitioning

Automated Rollback

Health Monitoring

Placement Constraints

Page 23: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Service Fabric: modelli di programmazione

Reliable Actors APIReliable Services API

Azure Private Clouds

Applications composed of microservices

High Availability

Hyper-Scale

Hybrid Operations

High Density

Rolling Upgrades Stateful

services

Low LatencyFast startup & shutdown

Container Orchestration & lifecycle management Replication &

Failover

Simple programming models

Load balancing

Self-healingData Partitioning

Automated Rollback

Health Monitoring

Placement Constraints

Service Fabric

Page 24: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

A set of independent machines; physical or virtual

Service Fabric: Typical datacenter

Page 25: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

A set of machines that Service Fabric stitches together to form a cluster

Clusters can scale to1000s of machines

Service Fabric Cluster: A federation of machines

Node

Node

Node

Node

Node

Node

Page 26: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Service Fabric: Machine failure detection

Time = t1

8376 50

46

64 New Node arrived61

Time = t2

8361

5046

Failures Detected

cluster reconfigured

8376

6450

46

Time = t0

Nodes failed

Page 27: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Controllo o «servizi PaaS»

Ultimate Control

Rapid Development

VMs /VM Scale Sets

VM ExtensionsService Fabric /

BatchWeb Apps/ App Service

IaaS PaaS

Page 28: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Introduzione alla next-gen computing platform su Azure:

http://channel9.msdn.com/Events/Build/2015/3-618

Microservizi e Docker su Azure (corso MVA):

http://channel9.msdn.com/Series/Exploring-Microservices-in-Docker-and-Microsoft-Azure

Service Fabric:

http://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started/

https://github.com/azure/servicefabric-samples

http://channel9.msdn.com/Events/Build/2015/2-640

http://channel9.msdn.com/Events/Build/2015/2-700

http://channel9.msdn.com/Events/Build/2015/2-717

http://channel9.msdn.com/Events/Build/2015/2-66

Link e approfondimenti

Page 29: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Domande?

Page 30: SVILUPPARE E GESTIRE ARCHITETTURE A MICROSERVIZI SU AZURE

Grazie a tutti per la partecipazione

Riceverete il link per il download a slide e demo via email nei prossimi giorni

Per contattarmi

su Twitter: @vflorusso

via e-mail: [email protected]

Grazie