SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Una PA agile, funzionale e serverless…
SI PUÒ FARE!
Federico Feroldi / @cloudify • Danilo Spinelli / @gunzip
Roma 2018
CC BY-NC-SA 3.0
Agenda
La genesi
Come l’abbiamo fatto
Presente e Futuro
agid.gov.it • @agidgov
teamdigitale.governo.it • @teamdigitaleit
La visione della “Cittadinanza Digitale”
Eliminare: raccomandate e
lettere, code allo sportello,
scadenze da ricordare,
moduli da compilare,
bollettini da pagare in
Posta!(e tanto altro)
I principi
Codice Open Source
Infrastruttura Cloud
Metodologia Agile e Lean
Le difficoltà
“Secondo me…”
“Serve una gara per…”
“Cloud ? Eccolo !”
“Quando sarà pronto ?”
Trasparenza totale (scrivere e condividere!)
Codice e Documentazione
Discussioni aperte (Pull Request)
Decisioni (Architecture Decision Records)
Backlog (Pivotal Tracker)
Automazione e tooling (gratis!)
Codice / Code Review (GitHub)
Build / Test (CircleCI)
Backlog e Planning (Pivotal Tracker)
Code Analysis (CodeClimate, Codacy, Snyk)
Efficienza (meno codice = meno bug e alta velocity)
Frameworks(Express, React Native)
Codice tipizzato(TypeScript, Flow)
Stile funzionale(fp-ts, io-ts, tslint-immutable)
Best practices (TSLint, ESLint, DangerJS)
PaaS (focus sulla business logic, non sull’infrastruttura)
Azure
Dati in Unione Europea
Serverless
Database/Message broker
Remote-first (usiamo tutto l’aiuto che troviamo)
Prendi l’iniziativa (Backlog→PR→Build→Merge)
Feedback continui (CircleCI → Slack)
Momenti di “sync” (Howdy, Hangouts)
Memo collaborativi (Google Docs)
L’architettura
Terraform
Infrastructure as Code
versioning e ambienti “riproducibili”
Parziale il supporto per Azure
resource "null_resource"
"azurerm_cosmosdb_collections" {
provisioner "local-exec" {
command = …
}
}
Notifiche e Preferenze: un’API per tutte le PA !
Auth & quota (API management)
Persistenza (Cosmos DB)
Integrazione (Storage Queues)
Business logic (Functions / TypeScript)
Azure Functions
Triggers & Actions
Una tecnologia in evoluzione
// update message visibilityTimeout
getDelaySecForRetries(numberOfRetries)
.map(visibilityTimeoutSec => {
queueService.updateMessage(
queueName, ... visibilityTimeoutSec,
() => …
});
Perchè Typescript
Type system ⋍ Meno bug !
Tools & Refactor (Visual Studio Code)
Feature di ES7 (async / await, spread
operator, ...) indipendentemente dalla versione di
NodeJS !
Functional Typescript
Ancora poco “functional”...
function apply<[...ArgumentsT], ResultT>(
fn: (...fnargs: ArgumentsT) => ResultT,
args: ArgumentsT
): ResultT
{
// args becomes any[]
// fn(...args)
}
apply((x: string, y: number) => ..., [“1”, 2])
Functional Typescript
...nel frattempo
Giulio Canti fp-ts
https://github.com/gcanti/fp-ts
Untyped Express controller
Prima…
async getProfile(req, res)
{
const fiscalCode = req.params.fiscal_code;
if (!isValid(fiscalCode)) {
return res.status(400)
.json({ error: “invalid code” });
}
const profile = await
Service.getProfile(fiscalCode);
res.status(200).json(profile);
}
Typed Express controller
...dopo
async getProfile(fiscalCode: FiscalCode):
Promise<Either<
ResponseError<QueryError>,
ResponseSuccess<Profile>>>
=>
(await Model.getProfile(fiscalCode))
.map(ResponseSuccess)
.mapLeft(ResponseError);
Linting
Imporre le “best practice”
Immutabilità, type decl “pervasive”, ...
Favorire uno stile coerente
Ordine degli import, indentazione, naming, ...
… ed efficientare l’onboarding
// tslint:disable:no-any
Deploy delle Azure Functions
gulp:release
Build & Test (tsc)
Bundle (riduce drasticamente startup time !)
Tag (push release tag)
Push (git push origin master)
Pull (tramite trigger automatico nelle Functions)
(git) push the candle back !
Rollback
Un po’ di metriche (9 mesi)
~170 User Stories
~300 Pull Requests
~900 Commits
~22.000 LoCs (80% TS, 20% JS)
What’s next
Lock-in Azure? (Docker, Kubernetes, Helm)
Community?
Quando sarà pronto?
github.com/
teamdigitale/
digital-citizenship
PR welcome!

Contenu connexe

Similaire à Una PA agile, funzionale e serverless: si può fare! by Federico Feroldi and Danilo Spinelli

Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...
Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...
Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...Roberto Albano
 
Silverlight in Action
Silverlight in ActionSilverlight in Action
Silverlight in ActionDotNetMarche
 
Webcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineWebcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineDavide Benvegnù
 
VSTS - L'ALM a portata di mano
VSTS - L'ALM a portata di manoVSTS - L'ALM a portata di mano
VSTS - L'ALM a portata di manoRiccardo Cappello
 
DevOps by examples - Agile O'Day 2017
DevOps by examples - Agile O'Day 2017DevOps by examples - Agile O'Day 2017
DevOps by examples - Agile O'Day 2017Giulio Vian
 
DevOps@Work 2017 - Application insights more control, more power
DevOps@Work 2017 - Application insights more control, more powerDevOps@Work 2017 - Application insights more control, more power
DevOps@Work 2017 - Application insights more control, more powerRoberto Albano
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webLuca Milan
 
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...Alessandro Alpi
 
Schedule - Progetto di Linguaggi e Modelli Computazionali M
Schedule - Progetto di Linguaggi e Modelli Computazionali MSchedule - Progetto di Linguaggi e Modelli Computazionali M
Schedule - Progetto di Linguaggi e Modelli Computazionali MDaniele Campogiani
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented ProgrammingAndrea Bozzoni
 
Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)DotNetMarche
 
Application insights - Power is nothing without control
Application insights - Power is nothing without controlApplication insights - Power is nothing without control
Application insights - Power is nothing without controlRoberto Albano
 
How I did it (in .NET): idiomatic Domain Driven Design
How I did it (in .NET): idiomatic Domain Driven DesignHow I did it (in .NET): idiomatic Domain Driven Design
How I did it (in .NET): idiomatic Domain Driven DesignAndrea Saltarello
 
CMDBuid Significato di una soluzione open source per la gestione del CMDB
CMDBuid Significato di una soluzione open source per la gestione del CMDBCMDBuid Significato di una soluzione open source per la gestione del CMDB
CMDBuid Significato di una soluzione open source per la gestione del CMDBCMDBuild org
 
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...Alessio Biasiutti
 
Meetup DotNetCode A.I. Bot Framework and Azure Functions
Meetup DotNetCode A.I. Bot Framework and Azure FunctionsMeetup DotNetCode A.I. Bot Framework and Azure Functions
Meetup DotNetCode A.I. Bot Framework and Azure Functionsdotnetcode
 
E suap - tecnologie client
E suap - tecnologie client E suap - tecnologie client
E suap - tecnologie client Sabino Labarile
 

Similaire à Una PA agile, funzionale e serverless: si può fare! by Federico Feroldi and Danilo Spinelli (20)

Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...
Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...
Application insights - Meet{cast} - Meetup #AperiTech dotNET{podcast} - Marzo...
 
Silverlight in Action
Silverlight in ActionSilverlight in Action
Silverlight in Action
 
Webcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio OnlineWebcast - Introduzione a Visual Studio Online
Webcast - Introduzione a Visual Studio Online
 
Html5
Html5Html5
Html5
 
VSTS - L'ALM a portata di mano
VSTS - L'ALM a portata di manoVSTS - L'ALM a portata di mano
VSTS - L'ALM a portata di mano
 
DevOps by examples - Agile O'Day 2017
DevOps by examples - Agile O'Day 2017DevOps by examples - Agile O'Day 2017
DevOps by examples - Agile O'Day 2017
 
DevOps@Work 2017 - Application insights more control, more power
DevOps@Work 2017 - Application insights more control, more powerDevOps@Work 2017 - Application insights more control, more power
DevOps@Work 2017 - Application insights more control, more power
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni web
 
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
DevOpsHeroes 2016 - Realizzare Continouous Integration con SQL Server e Visua...
 
Schedule - Progetto di Linguaggi e Modelli Computazionali M
Schedule - Progetto di Linguaggi e Modelli Computazionali MSchedule - Progetto di Linguaggi e Modelli Computazionali M
Schedule - Progetto di Linguaggi e Modelli Computazionali M
 
Aspect Oriented Programming
Aspect Oriented ProgrammingAspect Oriented Programming
Aspect Oriented Programming
 
Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)Introduzione al Domain Driven Design (DDD)
Introduzione al Domain Driven Design (DDD)
 
Application insights - Power is nothing without control
Application insights - Power is nothing without controlApplication insights - Power is nothing without control
Application insights - Power is nothing without control
 
How I did it (in .NET): idiomatic Domain Driven Design
How I did it (in .NET): idiomatic Domain Driven DesignHow I did it (in .NET): idiomatic Domain Driven Design
How I did it (in .NET): idiomatic Domain Driven Design
 
OrientDB & Big Data
OrientDB & Big DataOrientDB & Big Data
OrientDB & Big Data
 
CMDBuid Significato di una soluzione open source per la gestione del CMDB
CMDBuid Significato di una soluzione open source per la gestione del CMDBCMDBuid Significato di una soluzione open source per la gestione del CMDB
CMDBuid Significato di una soluzione open source per la gestione del CMDB
 
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...
Tutto quello che non vi hanno mai detto su Azure Integration Services (Logic ...
 
#dd12 Applicazioni a tre voci (Android e Domino)
#dd12 Applicazioni a tre voci (Android e Domino)#dd12 Applicazioni a tre voci (Android e Domino)
#dd12 Applicazioni a tre voci (Android e Domino)
 
Meetup DotNetCode A.I. Bot Framework and Azure Functions
Meetup DotNetCode A.I. Bot Framework and Azure FunctionsMeetup DotNetCode A.I. Bot Framework and Azure Functions
Meetup DotNetCode A.I. Bot Framework and Azure Functions
 
E suap - tecnologie client
E suap - tecnologie client E suap - tecnologie client
E suap - tecnologie client
 

Plus de Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaCodemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserCodemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
 

Plus de Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Una PA agile, funzionale e serverless: si può fare! by Federico Feroldi and Danilo Spinelli

  • 1. Una PA agile, funzionale e serverless… SI PUÒ FARE! Federico Feroldi / @cloudify • Danilo Spinelli / @gunzip Roma 2018 CC BY-NC-SA 3.0
  • 2. Agenda La genesi Come l’abbiamo fatto Presente e Futuro
  • 4. La visione della “Cittadinanza Digitale” Eliminare: raccomandate e lettere, code allo sportello, scadenze da ricordare, moduli da compilare, bollettini da pagare in Posta!(e tanto altro)
  • 5.
  • 6.
  • 7. I principi Codice Open Source Infrastruttura Cloud Metodologia Agile e Lean
  • 8.
  • 9. Le difficoltà “Secondo me…” “Serve una gara per…” “Cloud ? Eccolo !” “Quando sarà pronto ?”
  • 10.
  • 11. Trasparenza totale (scrivere e condividere!) Codice e Documentazione Discussioni aperte (Pull Request) Decisioni (Architecture Decision Records) Backlog (Pivotal Tracker)
  • 12. Automazione e tooling (gratis!) Codice / Code Review (GitHub) Build / Test (CircleCI) Backlog e Planning (Pivotal Tracker) Code Analysis (CodeClimate, Codacy, Snyk)
  • 13. Efficienza (meno codice = meno bug e alta velocity) Frameworks(Express, React Native) Codice tipizzato(TypeScript, Flow) Stile funzionale(fp-ts, io-ts, tslint-immutable) Best practices (TSLint, ESLint, DangerJS)
  • 14. PaaS (focus sulla business logic, non sull’infrastruttura) Azure Dati in Unione Europea Serverless Database/Message broker
  • 15. Remote-first (usiamo tutto l’aiuto che troviamo) Prendi l’iniziativa (Backlog→PR→Build→Merge) Feedback continui (CircleCI → Slack) Momenti di “sync” (Howdy, Hangouts) Memo collaborativi (Google Docs)
  • 16.
  • 18. Terraform Infrastructure as Code versioning e ambienti “riproducibili” Parziale il supporto per Azure resource "null_resource" "azurerm_cosmosdb_collections" { provisioner "local-exec" { command = … } }
  • 19. Notifiche e Preferenze: un’API per tutte le PA ! Auth & quota (API management) Persistenza (Cosmos DB) Integrazione (Storage Queues) Business logic (Functions / TypeScript)
  • 20. Azure Functions Triggers & Actions Una tecnologia in evoluzione // update message visibilityTimeout getDelaySecForRetries(numberOfRetries) .map(visibilityTimeoutSec => { queueService.updateMessage( queueName, ... visibilityTimeoutSec, () => … });
  • 21. Perchè Typescript Type system ⋍ Meno bug ! Tools & Refactor (Visual Studio Code) Feature di ES7 (async / await, spread operator, ...) indipendentemente dalla versione di NodeJS !
  • 22. Functional Typescript Ancora poco “functional”... function apply<[...ArgumentsT], ResultT>( fn: (...fnargs: ArgumentsT) => ResultT, args: ArgumentsT ): ResultT { // args becomes any[] // fn(...args) } apply((x: string, y: number) => ..., [“1”, 2])
  • 23. Functional Typescript ...nel frattempo Giulio Canti fp-ts https://github.com/gcanti/fp-ts
  • 24. Untyped Express controller Prima… async getProfile(req, res) { const fiscalCode = req.params.fiscal_code; if (!isValid(fiscalCode)) { return res.status(400) .json({ error: “invalid code” }); } const profile = await Service.getProfile(fiscalCode); res.status(200).json(profile); }
  • 25. Typed Express controller ...dopo async getProfile(fiscalCode: FiscalCode): Promise<Either< ResponseError<QueryError>, ResponseSuccess<Profile>>> => (await Model.getProfile(fiscalCode)) .map(ResponseSuccess) .mapLeft(ResponseError);
  • 26. Linting Imporre le “best practice” Immutabilità, type decl “pervasive”, ... Favorire uno stile coerente Ordine degli import, indentazione, naming, ...
  • 27. … ed efficientare l’onboarding // tslint:disable:no-any
  • 28. Deploy delle Azure Functions gulp:release Build & Test (tsc) Bundle (riduce drasticamente startup time !) Tag (push release tag) Push (git push origin master) Pull (tramite trigger automatico nelle Functions)
  • 29. (git) push the candle back ! Rollback
  • 30.
  • 31. Un po’ di metriche (9 mesi) ~170 User Stories ~300 Pull Requests ~900 Commits ~22.000 LoCs (80% TS, 20% JS)
  • 32. What’s next Lock-in Azure? (Docker, Kubernetes, Helm) Community? Quando sarà pronto?