Upload
dotnetcampus
View
71
Download
4
Embed Size (px)
Citation preview
Template designed by
Sviluppare e gestire architetture a microservizi su Azure
Vito Flavio [email protected] - @vflorussohttps://github.com/vflorusso/
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
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
L’evoluzione dell’architettura software
Desktop
Client
Server
Browser
Web Server
Db Server
Any Device
microservices
API Proxy
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”
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
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
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
Docker: Ecosistema
Docker Host
Docker Client
Docker Hub
Container A
Container B
…Source Code Repo
Create
Delete
List
Push
Pull
Private Repositories
Private Repositories
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
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
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
Azure PaaS – App Service / Data Stores
Doc DB
Web App
Azure CacheSQL DB
Microservice A
API App
Microservice B
Batch
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
Esempi di file JSON
https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/
Esempi di file JSON
https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/
Esempi di file JSON
https://azure.microsoft.com/en-us/documentation/articles/app-service-deploy-complex-application-predictably/
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
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
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
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
Controllo o «servizi PaaS»
Ultimate Control
Rapid Development
VMs /VM Scale Sets
VM ExtensionsService Fabric /
BatchWeb Apps/ App Service
IaaS PaaS
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
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