In ASP.NET Core 3.0 è stato introdotto il supporto a gRPC, una framework altamente performante per fare Remote Procedure Call (RPC). Leggero e molto efficiente, supportato da molti linguaggi, supporto ad una comunicazione bidirezionale, riduzione del consumo di banda...solo questi solo alcuni dei vantaggi che descrivono gRPC, e che durante la sessione cercheremo di capire se siano reali o meno.
Fatto sta che è una tecnologia assolutamente da conoscere e sfruttare nello sviluppo di app moderno, e non solamente in ambito web.
Codice: https://github.com/andreadottor/XE.Dottor.gRPC
Evento: https://www.xedotnet.org/eventi/grpc-and-c-optimising-night/
This talk outlines the features in containerd 1.1 smart client: I/O redirection from the client side, containerd namespaces to leverage a single runtime instance with a logical isolation from multiple clients (Kubernetes, Docker Engine, other systems), and containers as types in Golang when using containerd Go client library.
Additionally, it explains all the performance improvements brought by BuildKit, and the capabilities that it opens up because of it's modular architecture, enabling open source developers who create new build systems using BuildKit directly to create new front ends.
About 94% of AI Adopters are planning to use containers in the next 1 year. What’s driving this exponential growth? Faster time to deployment and Faster AI workload processing are the two major reasons. You can use GPUs in big data applications such as machine learning, data analytics, and genome sequencing. Docker containerization makes it easier for you to package and distribute applications. You can enable GPU support when using YARN on Docker containers. In this talk, I will demonstrate how Docker accelerates the AI workload development and deployment over the IoT Edge devices in efficient manner
Computing Performance: On the Horizon (2021)Brendan Gregg
Talk by Brendan Gregg for USENIX LISA 2021. https://www.youtube.com/watch?v=5nN1wjA_S30 . "The future of computer performance involves clouds with hardware hypervisors and custom processors, servers running a new type of BPF software to allow high-speed applications and kernel customizations, observability of everything in production, new Linux kernel technologies, and more. This talk covers interesting developments in systems and computing performance, their challenges, and where things are headed."
CRUSH is the powerful, highly configurable algorithm Red Hat Ceph Storage uses to determine how data is stored across the many servers in a cluster. A healthy Red Hat Ceph Storage deployment depends on a properly configured CRUSH map. In this session, we will review the Red Hat Ceph Storage architecture and explain the purpose of CRUSH. Using example CRUSH maps, we will show you what works and what does not, and explain why.
Presented at Red Hat Summit 2016-06-29.
Virtualization with KVM (Kernel-based Virtual Machine)Novell
As a technical preview, SUSE Linux Enterprise Server 11 contains KVM, which is the next-generation virtualization software delivered with the Linux kernel. In this technical session we will demonstrate how to set up SUSE Linux Enterprise Server 11 for KVM, install some virtual machines and deal with different storage and networking setups.
To demonstrate live migration we will also show a distributed replicated block device (DRBD) setup and a setup based on iSCSI and OCFS2, which are included in SUSE Linux Enterprise Server 11 and SUSE Linux Enterprise 11 High Availability Extension.
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
Après la petite intro sur le stockage distribué et la description de Ceph, Jian Zhang réalise dans cette présentation quelques benchmarks intéressants : tests séquentiels, tests random et surtout comparaison des résultats avant et après optimisations. Les paramètres de configuration touchés et optimisations (Large page numbers, Omap data sur un disque séparé, ...) apportent au minimum 2x de perf en plus.
This talk outlines the features in containerd 1.1 smart client: I/O redirection from the client side, containerd namespaces to leverage a single runtime instance with a logical isolation from multiple clients (Kubernetes, Docker Engine, other systems), and containers as types in Golang when using containerd Go client library.
Additionally, it explains all the performance improvements brought by BuildKit, and the capabilities that it opens up because of it's modular architecture, enabling open source developers who create new build systems using BuildKit directly to create new front ends.
About 94% of AI Adopters are planning to use containers in the next 1 year. What’s driving this exponential growth? Faster time to deployment and Faster AI workload processing are the two major reasons. You can use GPUs in big data applications such as machine learning, data analytics, and genome sequencing. Docker containerization makes it easier for you to package and distribute applications. You can enable GPU support when using YARN on Docker containers. In this talk, I will demonstrate how Docker accelerates the AI workload development and deployment over the IoT Edge devices in efficient manner
Computing Performance: On the Horizon (2021)Brendan Gregg
Talk by Brendan Gregg for USENIX LISA 2021. https://www.youtube.com/watch?v=5nN1wjA_S30 . "The future of computer performance involves clouds with hardware hypervisors and custom processors, servers running a new type of BPF software to allow high-speed applications and kernel customizations, observability of everything in production, new Linux kernel technologies, and more. This talk covers interesting developments in systems and computing performance, their challenges, and where things are headed."
CRUSH is the powerful, highly configurable algorithm Red Hat Ceph Storage uses to determine how data is stored across the many servers in a cluster. A healthy Red Hat Ceph Storage deployment depends on a properly configured CRUSH map. In this session, we will review the Red Hat Ceph Storage architecture and explain the purpose of CRUSH. Using example CRUSH maps, we will show you what works and what does not, and explain why.
Presented at Red Hat Summit 2016-06-29.
Virtualization with KVM (Kernel-based Virtual Machine)Novell
As a technical preview, SUSE Linux Enterprise Server 11 contains KVM, which is the next-generation virtualization software delivered with the Linux kernel. In this technical session we will demonstrate how to set up SUSE Linux Enterprise Server 11 for KVM, install some virtual machines and deal with different storage and networking setups.
To demonstrate live migration we will also show a distributed replicated block device (DRBD) setup and a setup based on iSCSI and OCFS2, which are included in SUSE Linux Enterprise Server 11 and SUSE Linux Enterprise 11 High Availability Extension.
Ceph: Open Source Storage Software Optimizations on Intel® Architecture for C...Odinot Stanislas
Après la petite intro sur le stockage distribué et la description de Ceph, Jian Zhang réalise dans cette présentation quelques benchmarks intéressants : tests séquentiels, tests random et surtout comparaison des résultats avant et après optimisations. Les paramètres de configuration touchés et optimisations (Large page numbers, Omap data sur un disque séparé, ...) apportent au minimum 2x de perf en plus.
Le projet OpenStack vise à créer une plate-forme open source Cloud computing, pour les Clouds publics et privés visant une évolutivité sans complexité. OpenStack est composé d'un certain nombre de composants libres qui forment ensemble une solution Cloud.
La NASA et Rackspace ont été les initiateurs de ce projet. Des grands noms du monde informatique se sont joints au projet tel que IBM, Dell, Canonical, Cisco, … etc. La mutualisation des efforts de développement ont fait du projet OpenStack l'un des projet les plus émergent, avec une release chaque 6 mois.
Short Introduction to Docker. These slides show the basic idea behind the container technology Docker. The slides present the basic features for the daily use with Docker, Docker Compose, Docker Machine and Docker Swarm.
Docker is specially important for DevOps, because it gives Software Developers more control about their dependencies in different environments.
Présentation portant sur le système de virtualisation Docker.
Langue : Français.
Auteur : Colin LEVERGER, me@colinleverger.fr, merci de citer vos sources ;)
Sources : Wikipedia / Docker site officiel : https://www.docker.com/
Join us to learn how to deploy your first containerized application on the most popular orchestration engine. You will understand the basic concepts of Kubernetes along with the terminology and the deployment architecture. We will show you everything from building a Docker image to going live with your application. Each attendee gets $300 credit to start using Google Container Engine!
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC ClustersGlenn K. Lockwood
How well does InfiniBand virtualized with SR-IOV really perform? SDSC carried out some initial application benchmarking studies and compared to the best-available commercial alternative to determine whether or not SR-IOV was a viable technology for closing the performance gap of virtualized HPC. The results were promising, and this technology will be used in Comet, SDSC's two-petaflop supercomputer being deployed in 2015.
Using eBPF for High-Performance Networking in CiliumScyllaDB
The Cilium project is a popular networking solution for Kubernetes, based on eBPF. This talk uses eBPF code and demos to explore the basics of how Cilium makes network connections, and manipulates packets so that they can avoid traversing the kernel's built-in networking stack. You'll see how eBPF enables high-performance networking as well as deep network observability and security.
Le projet OpenStack vise à créer une plate-forme open source Cloud computing, pour les Clouds publics et privés visant une évolutivité sans complexité. OpenStack est composé d'un certain nombre de composants libres qui forment ensemble une solution Cloud.
La NASA et Rackspace ont été les initiateurs de ce projet. Des grands noms du monde informatique se sont joints au projet tel que IBM, Dell, Canonical, Cisco, … etc. La mutualisation des efforts de développement ont fait du projet OpenStack l'un des projet les plus émergent, avec une release chaque 6 mois.
Short Introduction to Docker. These slides show the basic idea behind the container technology Docker. The slides present the basic features for the daily use with Docker, Docker Compose, Docker Machine and Docker Swarm.
Docker is specially important for DevOps, because it gives Software Developers more control about their dependencies in different environments.
Présentation portant sur le système de virtualisation Docker.
Langue : Français.
Auteur : Colin LEVERGER, me@colinleverger.fr, merci de citer vos sources ;)
Sources : Wikipedia / Docker site officiel : https://www.docker.com/
Join us to learn how to deploy your first containerized application on the most popular orchestration engine. You will understand the basic concepts of Kubernetes along with the terminology and the deployment architecture. We will show you everything from building a Docker image to going live with your application. Each attendee gets $300 credit to start using Google Container Engine!
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC ClustersGlenn K. Lockwood
How well does InfiniBand virtualized with SR-IOV really perform? SDSC carried out some initial application benchmarking studies and compared to the best-available commercial alternative to determine whether or not SR-IOV was a viable technology for closing the performance gap of virtualized HPC. The results were promising, and this technology will be used in Comet, SDSC's two-petaflop supercomputer being deployed in 2015.
Using eBPF for High-Performance Networking in CiliumScyllaDB
The Cilium project is a popular networking solution for Kubernetes, based on eBPF. This talk uses eBPF code and demos to explore the basics of how Cilium makes network connections, and manipulates packets so that they can avoid traversing the kernel's built-in networking stack. You'll see how eBPF enables high-performance networking as well as deep network observability and security.
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFSMorlini Gabriele
Esperienza di migrazione di un intero sistema informativo da VM a container, utilizzando Docker, Rancher e ZFS. Durante lo speech verrà mostrato come abbiamo ristrutturato il nostro sistema informativo aziendale affrontando tematiche di disaster recovery, monitoraggio e backup. Saranno illustrati i vantaggi ottenuti e le sfide che abbiamo dovuto affrontare durante la migrazione di Alfresco, Gitlab, Redmine, SemanticMediaWiki. Migrando a container abbiamo ottenuto backup online 24x7, la possibilità di creare ambienti on-demand per le migrazioni e l'indipendenza dal provider dell'infrastruttura.
La nostra infrastruttura di produzione a container con Docker, Rancher e ZFS Imola Informatica
Esperienza di migrazione di un intero sistema informativo da VM a container, utilizzando Docker, Rancher e ZFS. Durante lo speech verrà mostrato come abbiamo ristrutturato il nostro sistema informativo aziendale affrontando tematiche di disaster recovery, monitoraggio e backup. Saranno illustrati i vantaggi ottenuti e le sfide che abbiamo dovuto affrontare durante la migrazione di Alfresco, Gitlab, Redmine, SemanticMediaWiki. Migrando a container abbiamo ottenuto backup online 24x7, la possibilità di creare ambienti on-demand per le migrazioni e l'indipendenza dal provider dell'infrastruttura.
Nat come esporre servizi https senza esporre l'applicazioneGiuliano Latini
Review degli strumenti a disposizione e loro contestualizzazione per erogare servizi tramite il protocollo HTTP reso sicuro (HTTPS) utilizzando il servizio Internet Let's Encripts e confronto tra gli approcci tecnologici applicabili a Apache, Nginx e Traefik.
SignalR, il WebSocket che tanto ci mancavaAndrea Tosato
Sessione presentata a CodeGen 2018, evento di CloudGenVerona.
SignalR, il WebSocket che tanto ci mancava.
Vengono presentati scenari On-Premise e Cloud scalabili.
Kubernetes as HA time series server, a proposalGiuliano Latini
Grazie allo IoT e al basso costo della connettività mobile possiamo acquisire grosse quantità di dati eterogenei. Un possibile modo per organizzarli nell'ottica del monitoraggio e dell'analisi proattiva è l'uso dei Time Series Database come InfuxDB. Durante la sessione varrà proposta un'architettura in alta affidabilità, utilizzando il servizio AKS di Microsoft Azure, per implementare un sistema di raccolta e classificazione dati in serie temporali con console di visualizzazione, pronti per alimentare altri servizi presenti nell'infrastruttura Microsoft Azure. Una parte del talk sarà dedicata a mostrare l'uso dell'architettura proposta.
Open Source Day 2015 - DBaaS con Docker: un caso di studioPar-Tec S.p.A.
Il TechAdvisor Michelangelo Uberti spiega come realizzare un servizio di Database-as-a-Service basato su MySQL e Docker.
I punti trattati durante la presentazione sono:
- DB-as-a-Service: la semplicità del concept
- I possibili approcci
- Architettura di alto livello
- Focus sul Management Agent
- Orchestration at work
- Da cgroups a Docker
- Le sfide principali
- Quale futuro?
Per saperne di più, scaricate le slide e guardate il video della presentazione del nostro TechAdvisor su http://www.par-tec.it/dbaas-con-docker-un-caso-di-studio
Che cos’è Kubernetes? A cosa serve? Perché usarlo?
Queste sono alcune delle domande alle quali questo talk darà una risposta: verranno illustrate le origini della piattaforma, i problemi che mira a risolvere e il modo in cui li risolve.
Introdurremo e vedremo in azione alcuni dei concetti chiave di Kubernetes utili a gestire il deployment e lo scaling di applicazioni containerizzate, arrivando a discutere la gestione di aspetti più specifici tramite ConfigMaps, Secrets e Services.
SIGNALR TO-THE-MAX: VERSO IL WEB ED OLTRE!DotNetCampus
Vedremo come impiegare SignalR al massimo per realizzare una infrastruttura che serva a semplificare la creazione di HubHost da poter usare sia in modo tradizionale sia à-la WCF Service da sfruttare anche al di fuori dell'ambiente web per la comunicazione tra processi, approfondendo inoltre anche i meccanismi della Pipeline dell ErrorHandling per implementare Listener e Logger. Aggireremo inoltre una limitazione dell HubClient creandone una versione strong-typed completamente event-based.
Architetture web - Linguaggi e standard - Web server, application server, dat...Fulvio Corno
Master: Amministratore Linux - Livello Avanzato
Nel contesto della formazione professionale rivolta ad aziende ed enti pubblici, sono stati preparati ed erogati dei corsi di Amministratore di sistemi Linux, al livello base ed al livello avanzato.
Il contenuto del corso è allineato con alcuni moduli della certificazione LPIC (Linux Professional Institute Certification), a cavallo tra i livelli 1 e 2. Tutto il materiale didattico è disponibile liberamente con licenza Creative Commons BY-NC-SA.
I docenti del corso sono i proff. Giovanni Squillero, Bartolomeo Montrucchio e Fulvio Corno.
Maggiori informazioni: http://elite.polito.it/index.php/teaching/current-courses/255-master-linux-admin
Slide della sessione tenuta alla Blazor Conf 2022 (https://blazorconf.it/)
Sono convinto che uno sviluppatore Blazor debba conoscere JavaScript in quanto molte librerie (d'uso comune) non le troviamo disponibili su NuGet. Interagire con Google Maps, visualizzare dei grafici, utilizzare API del browser, ... In questa sessione vedremo come far dialogare questi due mondi che sono molto più vicini e lagati di quello che si pensa, ed il tutto con una serie di esempi pratici (e reali).
Stanco delle solite sessioni introduttive o generiche su blazor? Bene, questa è la serata che fa per te.
In questa sessione ho raccolto una serie di argomenti, problematiche e tips derivanti da due anni di utilizzo di Blazor (praticamente dal suo lancio). Casi reali affrontanti e risolti.
E come nel (ormai) classico format online di XE, ci sarà ampio spazio per le domande ed il confronto.
Dal RenderFragment ai Generics, tips for Blazor developersAndrea Dottor
Sessione tenuta alla Blazor Conference 2021 del 13.04.2021.
(https://www.aspitalia.com/eventi/87/Blazor-Conference-2021-Online.aspx)
Una sessione dove verranno presentati una serie di tips per migliorare e facilitare la scrittura delle nostre applicazioni: da codice html dinamico, al miglioramento ed organizzazione dello stesso. Il tutto per poter sfruttare ogni bit che Blazor può dare. Dal RenderFragment ai Generics. Consigli che arrivano da esperienze reali
Codice: https://github.com/andreadottor/XE.Dottor.Demo.BlazorWebApp
In questa sessione vedremo come uno sviluppatore WebForm possa essere velocemente produttivo (utilizzando le ultime versioni di ASP.NET Core) grazie a Blazor. Vedremo quindi cosa differenza un'applicazione ASP.NET Core, rispetto a quelle WebForm (.NET Framework) fino ad arrivare a comprendere perchè e come Blazor possa agevolare questa transizione.
Quindi una sessione non solo per chi è nuovo a Blazor, ma anche perchì ancora non ha migrato ad ASP.NET Core.
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Andrea Dottor
In questa sessione scopriremo come utilizzare al meglio di Health Check, funzionalità che è stata introdotta in ASP.NET ancora dalla versione 2.2, ma che poche applicazioni sfruttano.
Uno strumento davvero utile anche per un primo debug, o per una semplice verifica dello stato delle nostre applicazioni...e non solo per chi utilizza container e orchestratori.
Cosa ci permettono di sapere gli Health Check?
Come possiamo essere notificati se qualcosa non va nel verso giusto?
A queste e ad altre domande daremo risposta nel corso della sessione
In questa serata cercheremo di capire perchè Blazor ha riscosso così tanto successo, e lo faremo analizzando casi presi da applicazioni reali dove questa tecnologia è stata introdotta, così da capirne meglio le potenzialità (ma anche le eventuali criticità).
Come di consuetudine, faremo poi un confronto, così da condividere i vari punti di vista.
In questa sessione andremo in dettaglio sulle principali novità introdotte nella versione 3.0 di ASP.NET Core.
Code: https://github.com/andreadottor/VSSaturdayPN2019
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente Andrea Dottor
Molte applicazione sono (ancora) sviluppate in WebForm e non possono essere convertite automaticamente ad ASP.NET Core. Una riscrittura completa in molti casi è impossibile o impensabile da attuare. In questa sessione vedremo come migrare in modo graduale queste tipologie di applicazioni verso ASP.NET Core, andando in dettaglio nelle varie problematiche che solitamente si possono presentare. La sessione deriva da un'esperienza reale, che ha permesso di conoscere (nel bene o nel male) le difficoltà che si nascondo in queste migrazioni.
Evento: https://www.xedotnet.org/eventi/one-day-enterprise-application/
Real case: migrate from Web Forms to ASP.NET Core graduallyAndrea Dottor
Many application are developed in Web Forms and cannot be automatically converted to ASP.NET Core. Wait for rewrite all application in many case are impossible.
In this session are explained a way to gradually migrate to the new tecnology, and all the tricks for run the applications side by side (during the migration). And only when all are complete, dismiss the old. A real world case.
Non stiamo parlando di un ritorno a WebForm ma di un'evoluzione (o meglio) di un'alternativa al pattern MVC. Le Razor Pages possono essere un buon motore per smuovere le migrazioni di vecchie applicazioni, utilizzando un paradigma di pagina (vicino a quello che chi utilizza WebForm già conosce) ma con una visione e pulizia degna delle migliori applicazioni MVC .
Ecco che le Razor Pages si stanno ritagliano il loro spazio, ed in questa sessione cercheremo di affrontare i pro e contro del loro utilizzo, capendone al meglio i casi duso ideali.
Dependency injection questa sconosciutaAndrea Dottor
L'uscita di ASP.NET Core ha portato a una maggiore diffusione dell'utilizzo della DI (Dependency Injection) ma spesso senza che lo sviluppatore sappia la sua reale utilità o potenzialità.
Dependency Injection, uno dei design pattern della programmazione OOP. Una best-practice dello sviluppo che può portare alla semplificazione del codice scritto, facilitare il disacoppiamento, e migliorare la testabilità.
In questa sessione vedremo cos'è la DI e come utilizzarla intelligentemente all'interno dei nostri progetti.
Slide dell'evento "XE One Day - Good code" tenuto il 15.09.2018.
Il codice è disponibile alla pagina dell'evento https://www.xedotnet.org/eventi/one-day-good-code/
Slide dell'evento One Day Cache (http://www.xedotnet.org/eventi/one-day-performance-optimization/)
ABSTRACT: Cache, amica e nemica di molti dev.
Uno dei modi per incrementare le performance di un'applicativo è l'utilizzo della cache, ma non è tutto oro quel che luccica.
In questa sessione vedremo quali tipologie di cache esistono, ed il come poterle utilizzare al meglio. Output cache, cache applicativa, Redis, Memcached...cerchiamo di fare un pò di chiarezza e capiamo i pro e contro delle varie soluzioni.
ASP.NET Core 2.0 è stato ufficialmente rilasciato e porta con se parecchie novità come le Razor Pages, template aggiornati e l'integrazione con Application Insights migliorata. In questa cercheremo capiremo la vera maturità di questo framework, e quanto questo rilascio sia importante per noi dev.
Sessione tenuto presso la fiera "Punto di incontro" di Pordenone in data 03.11.2016
"L’evoluzione del web. Andrea Dottor, consulente informatico,
Microsoft MVP e docente ITS, illustra il percorso di
studi dando spazio ad alcune tecnologie/framework come
AngularJS e Bootstrap, spiegando perché saranno alla
base delle applicazioni del futuro."
2. SOAP
• PRO
• WSDL (permette la
generazione di
proxy)
• Standard W3C
• CONTRO
• Serializzazione XML
• Formato messaggi
troppo complesso
• Non facilmente
utilizzabile da
browser
WCF
• PRO
• Altamente
configurabile
• CONTRO
• Altamente
configurabile
• Non sempre
interoperabile
http API
• PRO
• Interoperabile
• Utilizzabile
facilmente dal
browser
• Aderente al
protocollo HTTP
• CONTRO
• Non è possibile far
generare un proxy *
• Lo sviluppatore deve
documentare DTO e
chiamate
• Non è uno Standard
Da dove arriviamo
3. SOAP
• PRO
• WSDL (permette la
generazione di
proxy)
• Standard W3C
• CONTRO
• Serializzazione XML
• Formato messaggi
troppo complesso
• Non facilmente
utilizzabile da
browser
WCF
• PRO
• Altamente
configurabile
• CONTRO
• Altamente
configurabile
• Non sempre
interoperabile
http API
• PRO
• Interoperabile
• Utilizzabile
facilmente dal
browser
• Aderente al
protocollo HTTP
• CONTRO
• Non è possibile far
generare un proxy *
• Lo sviluppatore deve
documentare DTO e
chiamate
• Non è uno Standard
Da dove arriviamo
4. SOAP
• PRO
• WSDL (permette la
generazione di
proxy)
• Standard W3C
• CONTRO
• Serializzazione XML
• Formato messaggi
troppo complesso
• Non facilmente
utilizzabile da
browser
WCF
• PRO
• Altamente
configurabile
• CONTRO
• Altamente
configurabile
• Non sempre
interoperabile
http API
• PRO
• Interoperabile
• Utilizzabile
facilmente dal
browser
• Aderente al
protocollo HTTP
• CONTRO
• Non è possibile far
generare un proxy *
• Lo sviluppatore deve
documentare DTO e
chiamate
• Non è uno Standard
Da dove arriviamo
6. In distributed computing a remote procedure call (RPC)
is when a computer program causes a procedure
(subroutine) to execute in another address space
(commonly on another computer on a shared network),
which is coded as if it were a normal (local)
procedure call, without the programmer explicitly
coding the details for the remote interaction.
That is, the programmer writes essentially the same
code whether the subroutine is local to the executing
program, or remote
[fonte: https://en.wikipedia.org/wiki/Remote_procedure_call]
RPC
7. RPC non è una cosa nuova!
• Response–request protocols
date to early distributed
computing in the late 1960s,
theoretical proposals of remote
procedure calls as the model of
network operations date to the
1970s, and practical
implementations date to the
early 1980s. Bruce Jay Nelson is
generally credited with coining
the term "remote procedure call"
in 1981
[fonte: https://en.wikipedia.org/wiki/Remote_procedure_call]
RPC
8.
9. A high performance, open-source universal RPC framework
gRPC is a modern open source high performance RPC
framework that can run in any environment. It can efficiently
connect services in and across data centers with pluggable
support for load balancing, tracing, health checking and
authentication. It is also applicable in last mile of distributed
computing to connect devices, mobile applications and
browsers to backend services.
https://grpc.io/
Cos'è gRPC
10. gRPC è l'evoluzione di Stubby, una tecnologia sviluppata
da Google per far comunicare i suoi microservizi (anche tra
data-center differenti)
• "For the past 15 years, Google has solved these problems
internally with Stubby, an RPC framework that consists of a
core RPC layer that can handle internet-scale of tens of
billions of requests per second (yes, billions!). Now, this
technology is available for anyone as part of the open-
source project called gRPC. It’s intended to provide the
same scalability, performance and functionality that we
enjoy at Google to the community at large."
[fonte: https://medium.com/@nakabonne/why-was-grpc-born-7e65bbca9633]
Progetto ora gestito da Cloud Native Computing Foundation
Un po' di storia di gRPC
12. Uso di HTTP/2 per la connessione
Vantaggi:
• binario (invece che testuale)
• utilizzo di una singola connessione tra client e server e
abilitazione del multiplexing per il download parallelo delle
risorse
• compressione degli header HTTP
• stessa semantica HTML di HTTP 1.1
[Test performance HTTP/1.1 vs HTTP/2: http://www.http2demo.io ]
HTTP/2 transport
13. Uso di Protocol Buffers per la definizione dei servizi e come
formato di serializzazione dei dati
• "Protocol buffers are a language-neutral, platform-
neutral extensible mechanism for serializing structured
data"
Sviluppato da Google https://developers.google.com/protocol-buffers/
Specifiche del linguaggio: https://developers.google.com/protocol-buffers/docs/proto
PRO:
• Serializzazione dei dati in formato binario
• Da 3 a 10 volte più piccolo di un XML
• Da 20 a 100 volte più veloce di un serializzatore o parser XML
Protocol Buffers
14. Protocol Buffers - proto file
Permette di definire:
• metodi esposti dai
servizi gRPC
• struttura dei
messaggi utilizzati
nei servizi
15. • Specifying Field Rules
• singular -> valore di default quando non viene
specificato nulla
• repeated
• Scalar Value Types:
• double, float, int32, int64, *int64, uint32, uint64,
sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool,
string, bytes
• In proto3 non sono ammessi campi opzionali
• I null nei Value Types vanno gestiti manualmente
es: Google.Protobuf.WellKnownTypes
Protocol Buffers - Language Guide
17. Language Platform Compiler
C/C++ Linux/Mac
GCC 4.8+
Clang 3.3+
C/C++ Windows 7+ Visual Studio 2015+
C# Linux/Mac .NET Core, Mono 4+
C# Windows 7+ .NET Core, .NET 4.5+
Dart Windows/Linux/Mac Dart 2.0+
Go Windows/Linux/Mac Go 1.6+
Java Windows/Linux/Mac JDK 8 recommended. Gingerbread+ for Android
Node.js Windows/Linux/Mac Node v4+
Objective-C Mac OS X 10.11+/iOS 7.0+ Xcode 7.2+
PHP (Beta) Linux/Mac PHP 5.5+ and PHP 7.0+
Python Windows/Linux/Mac Python 2.7 and Python 3.4+
Ruby Windows/Linux/Mac Ruby 2.3+
Code Generation
18. • Il package NuGet Grpc.Tools contiene il plugin protoc e
protobuf in C# utile a generare il codice (server e client).
A partire dalla versione 1.17 il package si integra con
MSBuild e permette di generare automaticamente il codice
C# a partire dai file .proto.
• La build build rigenera I seguenti files nella cartella
Greeter/obj/Debug/TARGET_FRAMEWORK:
• Greet.cs contiene tutto il codice di Procol Buffer utile a
popolare, serializzare e tutte le classi di request e response
• GreetGrpc.cs contiene il codice generato del client e/o
server, ed include:
• una classe astratta Greeter.GreeterBase da cui ereditare
per implementare il servizio Greeter
• una classe Greeter.GreeterClient utile per chiamare I
metodi esposti dal servizio remoto Greeter
C# Tooling support for .proto files
19. • Installare il package nuget Grpc.AspNetCore
• Abilitare gRPC con AddGrpc
• Aggiungere ogni servizio gRPC alla pipeline di routing con MapGrpcService
gRPC services with ASP.NET Core
21. • Unary: Quando il client invia una singola richiesta ed il
server risponde, come fosse una normale chiamata ad
una funzione
• Server streaming: Il client invia una richiesta al
server e ottiene uno stream per leggere in sequenza i
messaggi ritornati. Il client continua la lettura fino a
che non ci son più messaggi.
• Client streaming: Il client invia una sequenza di
messaggi al server utilizzando uno stream. Quando il
client completa l'invio, attende che il server ritorni una
risposta.
• BiDi streaming: Sia il server che il client inviano e
leggono i messaggi utilizzando due stream
indipendenti. L'ordine dei messaggi in ogni stream
viene mantenuto.
gRPC Service Definitions
23. • Con ASP.NET Core sono suppertati i seguenti metodi di
autenticazione:
• Azure Active Directory
• Client Certificate
• IdentityServer
• JWT Token
• OAuth 2.0
• OpenID Connect
• WS-Federation
• Decorare il servizio con l'attributo [Authorize]
• Valido sia a livello di classe che di singolo metodo
Authentication and authorization
24. gRPC HTTP API
Strong Typing Serialization
Streaming Request-Response
HTTP/2 HTTP/1.1
Protobuf JSON
"gRPC largely follows HTTP semantics over HTTP/2 but we
explicitly allow for full-duplex streaming. We diverge from
typical REST conventions as we use static paths for
performance reasons during call dispatch as parsing call
parameters from paths, query parameters and payload body
adds latency and complexity. We have also formalized a set
of errors that we believe are more directly applicable to API
use cases than the HTTP status codes."
gRPC vs HTTP APIs (REST)
25. In .NET core non sarà possible realizzare servizi
Windows Communication Foundation (WCF),
e non verrà fatto il porting nemmeno in .NET 5
• https://devblogs.microsoft.com/dotnet/supporting-the-
community-with-wf-and-wcf-oss-projects/
In .NET Core è stato portato solamente la possibilità di
consumare servizi WCF
• https://github.com/dotnet/wcf
gRPC vs WCF
26. I servizi gRPC non possono essere sfruttati completamente da browser **
gRPC ad oggi non verrà utilizzato da SignalR
Esistono scenari per cui SingalR è da preferire
• Broadcast real-time communication – gRPC supports real-time
communication via streaming, but the concept of broadcasting a
message out to registered connections doesn't exist. For example in a
chat room scenario where new chat messages should be sent to all
clients in the chat room, each gRPC call is required to individually
stream new chat messages to the client. SignalR is a useful framework
for this scenario. SignalR has the concept of persistent connections and
built-in support for broadcasting messages.
gRPC vs SignalR
27. gRPC-Web è una libreria JavaScript che permette l'interazione
con servizi gRPC
https://github.com/grpc/grpc-web
Richiede l'uso di un proxy che adatti le chiamate al servizio
https://www.envoyproxy.io/
gRPC-Web
28. Lightweight microservices where efficiency is critical.
Polyglot systems where multiple languages are required
for development.
Point-to-point real-time services that need to handle
streaming requests or responses.
Mobile clients which are communicating to a cloud server.
Quali sono i casi d'uso ideali?
30. Square
• gRPC — cross-platform open source RPC over HTTP/2
https://medium.com/square-corner-blog/grpc-cross-platform-open-source-rpc-over-http-2-
56c03b5a0173
Netflix
• Increasing Developer Productivity and Defeating the Thundering Herd with gRPC
https://www.cncf.io/netflix-case-study/
Spotify
• The Story of Why We Migrate to gRPC and How We Go About It
https://www.youtube.com/watch?v=fMq3IpPE3TU
Twilio
• Intro to gRPC: A Modern Toolkit for Microservice Communication
https://www.youtube.com/watch?v=RoXT_Rkg8LA
WePay
• Migrating APIs from REST to gRPC at WePay
https://wecode.wepay.com/posts/migrating-apis-from-rest-to-grpc-at-wepay
Docker
• Containerd: a daemon to control runC
https://blog.docker.com/2015/12/containerd-daemon-to-control-runc/
Cisco
• Getting Started With gRPC in Cisco IOS XR
https://github.com/CiscoDevNet/grpc-getting-started
…
Alcune aziende che hanno migrato i loro servizi
31. • gRPC and why it can save you development time
https://medium.com/red-crane/grpc-and-why-it-can-save-you-
development-time-436168fd0cbc
• ASP.NET Community Standup - June 4th, 2019 - gRPC!
https://www.youtube.com/watch?v=Pa6qtu1wIs8
• Calling gRPC Services With Server-side Blazor
https://chrissainty.com/calling-grpc-services-with-server-side-blazor/
• gRPC for ASP.NET Core 3.0
https://mustak.im/grpc-for-asp-net-core-3-0/
• From ’00s to ’20s: migrating from RESTful to gRPC
https://medium.com/@giefferre/from-00s-to-20s-migrating-from-
restful-to-grpc-5a5aa0cf27ba
• Envoy and gRPC-Web: a fresh new alternative to REST
https://blog.envoyproxy.io/envoy-and-grpc-web-a-fresh-new-
alternative-to-rest-6504ce7eb880
links