SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
DATA SATURDAY #20
Pordenone, Feb 26th, 2022
Azure SQL Database Ledger
Gianluca Hotz @glhotz
Data Platform MVP - Presidente UGISS.ORG
Sponsor
PREMIUM SPONSORS
SUPPORTING SPONSORS
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Chi sono?
• Gianluca Hotz | @glhotz | ghotz@ugiss.org
• Consulente indipendente
• 25 anni su SQL Server (dalla 4.21 nel 1996)
• Modellazione e sviluppo database, dimensionamento e amministrazione database server, aggiornamenti e
migrazioni, performance tuning
• Community
• 23 anni Microsoft MVP SQL Server/Data Platform (dal 1998)
• VMware Experts SQL Server
• Fondatore e presidente UGISS (ex «PASS Chapter»)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Tecnologie «Ledger» e «Digital Trust»
Le aziende si stanno spostando da
intermediari e audit manuali che sono
lenti e costosi…
...a tecnologie «Ledger» che riducono i
costi, fanno risparmiare tempo e
riducono i rischi
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Previsioni crescita mercato «blockchain»
https://www.forbes.com/sites/robertanzalone/2020/05/13/will-enterprise-
blockchain-survive-a-new-report-says-that-the-blockchain-technology-market-
will-reach-21-billion-by-2025/#7a5f793954b8
Gartner Predicts 2019: Blockchain Technologies
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Transaction
Node(s)
Member 2
Validator
Node(s)
Transaction
Node(s)
Member 3
Validator
Node(s)
Transaction
Node(s)
Member 1
Validator
Node(s)
No data integrity
off-chain
«Blockchain» esagerate in scenari centralizzati
• Decentramento richiede a tutte le parti di
ospitare nodi per partecipare al consenso
• Regole di «governance» devono essere
stabilite dal consorzio e distribuite/gestite
• Latenza associata a consenso può influire
su velocità effettiva transazioni
(<1000 TPS per «Ethereum»
• Archiviazione «off-chain» per interrogazioni
è tipica, ma integrità si perde nel processo
• Sistemi personalizzati con tool immaturi
rendono sviluppo e gestione impegnativi
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Rende dati in SQL a
prova di manomissione
tramite crittografia
Fornisce traccia
cronologica delle
modifiche, verificata
tramite prove
crittografiche
Lo stesso SQL Server già
usato in Azure e «on-
premises»
Azure SQL Database Ledger
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Append-Only
Ledger Table
Trusted
Storage
Database Ledger
Block N Block N-1 Block N-2
Updatable
Ledger Table
History Table
Ledger View
Tabelle «Ledger»
• «Updatable» permettono «insert/update/delete»
• Cronologia aggiornamento mantenuta tabella
storica e nella «Ledger View» di facile consultazione
• Integrità tabelle «aggiornabile» e «storico»
mantenuta tramite collegamenti crittografici nel
«Database Ledger»
• Ricevute digitali caricate periodicamente in storage
attendibile configurato dal cliente
• Cliente può utilizzare ricevute digitali per verificare
integrità dei dati
• «Append-Only» permesso solo «insert»
• rimuovono necessità tabella «storico»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
«Database Ledger»
• Cattura incrementalmente stato database
• A livello logico: «blockchain» e strutture dati «Merkle Tree»
• Cattura anche metadati transazione (es. timestamp, utente)
• Blocchi e informazioni transazioni in tabelle di sistema
• sys.database_ledger_transactions
• sys.database_ledger_blocks
• Blocchi chiusi
• ogni 30 secondi
• oppure esecuzione manuale sys.sp_generate_database_ledger_digest
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
• Cattura incrementalmente stato database
• A livello logico: «blockchain» e strutture dati «Merkle Tree»
• Cattura anche metadati transazione (es. timestamp, utente)
• Blocchi e informazioni transazioni
in tabelle di sistema
• sys.database_ledger_transactions
• sys.database_ledger_blocks
• Blocchi chiusi
• ogni 30 secondi
• oppure esecuzione manuale
sys.sp_generate_database_ledger_digest
«Database Ledger»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
«Database Digest»
• Hash ultimo blocco «Ledger»
• Rappresenta stato di tutte le tabelle «Ledger»
• Devono essere mantenuti in uno storage affidabile e immutabile
• Altrimenti si potrebbero manomettere le informazioni (in teoria)
• Possibilità di generarli manualmente o in automatico
• Generati in automatico possono essere anche salvati in automatico
• «Immutable Blob Storage»
• «Azure Confidential Ledger» (ACL)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Storage attendibile
«Immutable Blob Storage»
• Storage «Write Once, Read Many»
basato su policy
• BLOB possono essere impostati in sola
lettura per intervallo specificato
• Dati bloccati solo funzionalmente in
base a policy
• Supporto per «audit logging» ma
creatore log deve essere considerato
attendibile
• Microsoft è la «Trusted Computing
Base»
«Azure Confidential Ledger» (ACL)
• Storage «Write Once, Read Many» in
perpetuo
• BLOB scritti nel «Ledger» non possono
essere modificati
• Utilizza «Confidential Enclaves» a prova di
manomissione
• Crea ricevute transazioni e file «Ledger»
serializzati contenenti informazioni che
possono essere verificate dai clienti
• Microsoft è fuori dalla «TCB», codice
sorgente è open source (Confidential
Consortium Framework)
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Verifica del «Ledger»
• Manomissione possibile a meno di modifiche impedite/tracciate
• Es. modifica diretta file dati, DBCC WRITEPAGE, «hijacking» processo di SQL Server, ecc.
• Verifica ricalcola tutti gli hash e li confronta con i «digest»
• Operazione richiede uso intensivo di risorse
• Verificare
• quando necessario (es. sospetto manomissione, audit)
• su base ricorrente (es. giornalmente, ogni ora)
• Verifica tramite procedura di sistema dipende da modalità salvataggio
• automatico: passando indirizzo storage
• manuale: passando documento JSON con «Digest»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
«Ledger auditing»
• Nuovi eventi SQL Audit
• ENABLE LEDGER
• Creazione tabelle (o conversione, non ancora supportata)
• ALTER LEDGER
• Eliminazione/cambio nome tabelle (non ancora supportati)
• GENERATE LEDGER DIGEST
• VERIFY LEDGER
• LEDGER_OPERATION_GROUP
Demo
Abilitazione Database Ledger
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Selezione opzione «deployment»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Creazione Database
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Configurazione «Ledger»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
«Digest Storage»
Demo
Ledger Tables
Demo
Verifica Database
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Limitazioni generali
• Opzione a livello di database non può essere disabilitata
• No conversione tabelle esistenti
• No cambio di nome o spostamento di «schema»
• No eliminazione dati tabelle di storico (tabelle aggiornabili)
• Transazione può aggiornare solo (!) 200 tabelle
• «Long-term backups» (LTR) non supportati
• «Ledger» aggiornabili ereditano limitazioni tabelle temporali
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Limitazioni di interoperabilità
• Tabelle «In-memory» non supportate
• No operazioni di SWITCH IN/OUT
• No indici di tipo «Full-Text»
• No indice «non-clustered rowstore» con «clustered columnstore»
• No «Change Tracking»
• No tabelle FILETABLE
• No utilizzo API UPDATETEXT e WRITETEXT
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Limitazioni schema
• Numero massimo di colonne (sempre 1024)
• Tabelle aggiornabili +4 colonne
• Tabelle solo accodamento +2 colonne
• Aggiunta solo di colonne «nullable» (senza WITH VALUES)
• No eliminazione colonne, modifica limitata:
• NULL/NOT NULL, lunghezza tipi a lunghezza variabile, SPARSE
• «Collation» per tipi Unicode, se non cambia «code page» per gli altri
• No tipi dato XML, FILESTREAM, SqlVariant e «user-defined»
• Colonne «computed» solo deterministiche
• No «Sparse Column Set»
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Scenari per tabelle «Ledger»
• In generale: quelli che necessitano solo della «Forward Integrity»
• Sistema attendibile al processamento della transazione, protetto contro manomissioni future
• Alcuni esempi
• Semplificazione scenari di audit
• Verifica crittografica manomissione dati verso terze parti (interne o esterne)
• Processi aziendali tra più parti
• Alternativa a «blockchain» per sistemi intrinsecamente centralizzati in ottica «trust, but verify»
• Storage «off-chain» affidabile per interrogazioni dati «blockchain»
• «Choosing an Azure ledger technology»
• https://techcommunity.microsoft.com/t5/azure-sql/choosing-an-azure-ledger-technology/ba-p/2450502
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Risorse
• Announcement blog
• https://aka.ms/sql-ledger-blog
• Azure SQL Database ledger Documentation
• https://aka.ms/sql-ledger-docs
• Whitepaper
• https://aka.ms/sql-ledger-whitepaper
#CDays14 – Milano 25, 26 e 27 Febbraio 2014
Grazie!
• Q&A

Contenu connexe

Tendances

Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017
MongoDB
 
Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2
Emanuele Zanchettin
 
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2016
 

Tendances (20)

Azure SQL Database Ledger
Azure SQL Database LedgerAzure SQL Database Ledger
Azure SQL Database Ledger
 
Best Practices on SQL Server
Best Practices on SQL ServerBest Practices on SQL Server
Best Practices on SQL Server
 
SQL Server Failover Cluster Instances con Azure Managed Disks
SQL Server Failover Cluster Instances con Azure Managed DisksSQL Server Failover Cluster Instances con Azure Managed Disks
SQL Server Failover Cluster Instances con Azure Managed Disks
 
Mettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql serverMettere in sicurezza ambienti sql server
Mettere in sicurezza ambienti sql server
 
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
Come utilizzare AWS Database Migration Service per migrare SQL Server ad Amaz...
 
SQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybaseSQL Server Data Virtualization with polybase
SQL Server Data Virtualization with polybase
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
SQL Server Modern Query Processing
SQL Server Modern Query ProcessingSQL Server Modern Query Processing
SQL Server Modern Query Processing
 
Azure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integrationAzure Data Factory: l'evoluzione della specie della data integration
Azure Data Factory: l'evoluzione della specie della data integration
 
Novità di SQL Server 2017
Novità di SQL Server 2017Novità di SQL Server 2017
Novità di SQL Server 2017
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
JBoss Data Grid Tech Lab
JBoss Data Grid Tech LabJBoss Data Grid Tech Lab
JBoss Data Grid Tech Lab
 
Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017Microservices webinar EMEA Aug. 2017
Microservices webinar EMEA Aug. 2017
 
Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2Implementare e mantenere un progetto azure sql database v.2
Implementare e mantenere un progetto azure sql database v.2
 
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL ServerSql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
Sql start!2019 Migliorare la produttività per lo sviluppo su SQL Server
 
Codemotion fuse presentation
Codemotion fuse presentationCodemotion fuse presentation
Codemotion fuse presentation
 
Azure for Game Developers
Azure for Game DevelopersAzure for Game Developers
Azure for Game Developers
 
SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC SDS,la pietra d’angolo dell SDDC
SDS,la pietra d’angolo dell SDDC
 
Data grid
Data gridData grid
Data grid
 
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
festival ICT 2013: Windows Server 2012 R2: Lo Storage Enterprise per Tutti
 

Similaire à Azure SQL Database Ledger

Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015
Codemotion
 
OCP-Architettura e caratteristiche della PaaS
OCP-Architettura e caratteristiche della PaaSOCP-Architettura e caratteristiche della PaaS
OCP-Architettura e caratteristiche della PaaS
opencityplatform
 
ManageEngine AD360 - Gestione e reporting Active Directory
ManageEngine AD360 - Gestione e reporting Active DirectoryManageEngine AD360 - Gestione e reporting Active Directory
ManageEngine AD360 - Gestione e reporting Active Directory
ManageEngine Italia
 

Similaire à Azure SQL Database Ledger (20)

IaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloudIaaS and PaaS relational databases in the cloud
IaaS and PaaS relational databases in the cloud
 
CDays15 - AZ08 - DocumentDB: il NoSql secondo Azure
CDays15 - AZ08 - DocumentDB: il NoSql secondo AzureCDays15 - AZ08 - DocumentDB: il NoSql secondo Azure
CDays15 - AZ08 - DocumentDB: il NoSql secondo Azure
 
Azure Synapse: data lake & modern data warehouse dalla A alla Z
Azure Synapse: data lake &  modern data warehouse dalla A alla ZAzure Synapse: data lake &  modern data warehouse dalla A alla Z
Azure Synapse: data lake & modern data warehouse dalla A alla Z
 
Multitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL DatabaseMultitenancy con SQL Server e Azure SQL Database
Multitenancy con SQL Server e Azure SQL Database
 
SQL Server Benchmarking, Baselining and Workload Analysis
SQL Server Benchmarking, Baselining and Workload AnalysisSQL Server Benchmarking, Baselining and Workload Analysis
SQL Server Benchmarking, Baselining and Workload Analysis
 
Azure sql database
Azure sql databaseAzure sql database
Azure sql database
 
RDBMS: pregi e difetti
RDBMS: pregi e difettiRDBMS: pregi e difetti
RDBMS: pregi e difetti
 
OCP Paas_ultima
OCP Paas_ultimaOCP Paas_ultima
OCP Paas_ultima
 
Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015Infinispan codemotion - Codemotion Rome 2015
Infinispan codemotion - Codemotion Rome 2015
 
OCP-Architettura e caratteristiche della PaaS
OCP-Architettura e caratteristiche della PaaSOCP-Architettura e caratteristiche della PaaS
OCP-Architettura e caratteristiche della PaaS
 
Gestione completa di active directory & exchange - User Conference ManageEngi...
Gestione completa di active directory & exchange - User Conference ManageEngi...Gestione completa di active directory & exchange - User Conference ManageEngi...
Gestione completa di active directory & exchange - User Conference ManageEngi...
 
Gestione completa di active directory & exchange
Gestione completa di active directory & exchangeGestione completa di active directory & exchange
Gestione completa di active directory & exchange
 
Metadata Driven Pipeline with Microsoft Fabric
Metadata Driven Pipeline  with Microsoft FabricMetadata Driven Pipeline  with Microsoft Fabric
Metadata Driven Pipeline with Microsoft Fabric
 
ManageEngine AD360 - Gestione e reporting Active Directory
ManageEngine AD360 - Gestione e reporting Active DirectoryManageEngine AD360 - Gestione e reporting Active Directory
ManageEngine AD360 - Gestione e reporting Active Directory
 
Tutto su ASP.NET Identity
Tutto su ASP.NET IdentityTutto su ASP.NET Identity
Tutto su ASP.NET Identity
 
SQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query ProcessingSQL Server 2022 Intelligent Query Processing
SQL Server 2022 Intelligent Query Processing
 
Azure No-Sql approach: DocumentDB
Azure No-Sql approach: DocumentDBAzure No-Sql approach: DocumentDB
Azure No-Sql approach: DocumentDB
 
Sviluppare SPA con Vue
Sviluppare SPA con VueSviluppare SPA con Vue
Sviluppare SPA con Vue
 
Alfresco Day Roma 2015: Big Repository
Alfresco Day Roma 2015: Big RepositoryAlfresco Day Roma 2015: Big Repository
Alfresco Day Roma 2015: Big Repository
 
Sviluppare SPA con Vue.js
Sviluppare SPA con Vue.jsSviluppare SPA con Vue.js
Sviluppare SPA con Vue.js
 

Plus de Gianluca Hotz

Plus de Gianluca Hotz (11)

Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)Microsoft SQL Server PaaS (Platform as a Service)
Microsoft SQL Server PaaS (Platform as a Service)
 
SQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & PerformanceSQL Server 2022 Programmability & Performance
SQL Server 2022 Programmability & Performance
 
Le novità di SQL Server 2022
Le novità di SQL Server 2022Le novità di SQL Server 2022
Le novità di SQL Server 2022
 
Data Integrity with SQL Database Ledger
Data Integrity with SQL Database LedgerData Integrity with SQL Database Ledger
Data Integrity with SQL Database Ledger
 
Best Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWSBest Practices for Running Microsoft SQL Server on AWS
Best Practices for Running Microsoft SQL Server on AWS
 
SQL Server Modernization
SQL Server ModernizationSQL Server Modernization
SQL Server Modernization
 
Le novità di sql server 2019
Le novità di sql server 2019Le novità di sql server 2019
Le novità di sql server 2019
 
SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5SQL Server 2019 CTP 2.5
SQL Server 2019 CTP 2.5
 
Azure PaaS databases
Azure PaaS databasesAzure PaaS databases
Azure PaaS databases
 
SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4SQL Server 2019 CTP2.4
SQL Server 2019 CTP2.4
 
SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2SQL Server 2019 ctp2.2
SQL Server 2019 ctp2.2
 

Azure SQL Database Ledger

  • 1. DATA SATURDAY #20 Pordenone, Feb 26th, 2022 Azure SQL Database Ledger Gianluca Hotz @glhotz Data Platform MVP - Presidente UGISS.ORG
  • 3. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Chi sono? • Gianluca Hotz | @glhotz | ghotz@ugiss.org • Consulente indipendente • 25 anni su SQL Server (dalla 4.21 nel 1996) • Modellazione e sviluppo database, dimensionamento e amministrazione database server, aggiornamenti e migrazioni, performance tuning • Community • 23 anni Microsoft MVP SQL Server/Data Platform (dal 1998) • VMware Experts SQL Server • Fondatore e presidente UGISS (ex «PASS Chapter»)
  • 4. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Tecnologie «Ledger» e «Digital Trust» Le aziende si stanno spostando da intermediari e audit manuali che sono lenti e costosi… ...a tecnologie «Ledger» che riducono i costi, fanno risparmiare tempo e riducono i rischi
  • 5. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Previsioni crescita mercato «blockchain» https://www.forbes.com/sites/robertanzalone/2020/05/13/will-enterprise- blockchain-survive-a-new-report-says-that-the-blockchain-technology-market- will-reach-21-billion-by-2025/#7a5f793954b8 Gartner Predicts 2019: Blockchain Technologies
  • 6. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Transaction Node(s) Member 2 Validator Node(s) Transaction Node(s) Member 3 Validator Node(s) Transaction Node(s) Member 1 Validator Node(s) No data integrity off-chain «Blockchain» esagerate in scenari centralizzati • Decentramento richiede a tutte le parti di ospitare nodi per partecipare al consenso • Regole di «governance» devono essere stabilite dal consorzio e distribuite/gestite • Latenza associata a consenso può influire su velocità effettiva transazioni (<1000 TPS per «Ethereum» • Archiviazione «off-chain» per interrogazioni è tipica, ma integrità si perde nel processo • Sistemi personalizzati con tool immaturi rendono sviluppo e gestione impegnativi
  • 7. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Rende dati in SQL a prova di manomissione tramite crittografia Fornisce traccia cronologica delle modifiche, verificata tramite prove crittografiche Lo stesso SQL Server già usato in Azure e «on- premises» Azure SQL Database Ledger
  • 8. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Append-Only Ledger Table Trusted Storage Database Ledger Block N Block N-1 Block N-2 Updatable Ledger Table History Table Ledger View Tabelle «Ledger» • «Updatable» permettono «insert/update/delete» • Cronologia aggiornamento mantenuta tabella storica e nella «Ledger View» di facile consultazione • Integrità tabelle «aggiornabile» e «storico» mantenuta tramite collegamenti crittografici nel «Database Ledger» • Ricevute digitali caricate periodicamente in storage attendibile configurato dal cliente • Cliente può utilizzare ricevute digitali per verificare integrità dei dati • «Append-Only» permesso solo «insert» • rimuovono necessità tabella «storico»
  • 9. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 «Database Ledger» • Cattura incrementalmente stato database • A livello logico: «blockchain» e strutture dati «Merkle Tree» • Cattura anche metadati transazione (es. timestamp, utente) • Blocchi e informazioni transazioni in tabelle di sistema • sys.database_ledger_transactions • sys.database_ledger_blocks • Blocchi chiusi • ogni 30 secondi • oppure esecuzione manuale sys.sp_generate_database_ledger_digest
  • 10. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 • Cattura incrementalmente stato database • A livello logico: «blockchain» e strutture dati «Merkle Tree» • Cattura anche metadati transazione (es. timestamp, utente) • Blocchi e informazioni transazioni in tabelle di sistema • sys.database_ledger_transactions • sys.database_ledger_blocks • Blocchi chiusi • ogni 30 secondi • oppure esecuzione manuale sys.sp_generate_database_ledger_digest «Database Ledger»
  • 11. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 «Database Digest» • Hash ultimo blocco «Ledger» • Rappresenta stato di tutte le tabelle «Ledger» • Devono essere mantenuti in uno storage affidabile e immutabile • Altrimenti si potrebbero manomettere le informazioni (in teoria) • Possibilità di generarli manualmente o in automatico • Generati in automatico possono essere anche salvati in automatico • «Immutable Blob Storage» • «Azure Confidential Ledger» (ACL)
  • 12. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Storage attendibile «Immutable Blob Storage» • Storage «Write Once, Read Many» basato su policy • BLOB possono essere impostati in sola lettura per intervallo specificato • Dati bloccati solo funzionalmente in base a policy • Supporto per «audit logging» ma creatore log deve essere considerato attendibile • Microsoft è la «Trusted Computing Base» «Azure Confidential Ledger» (ACL) • Storage «Write Once, Read Many» in perpetuo • BLOB scritti nel «Ledger» non possono essere modificati • Utilizza «Confidential Enclaves» a prova di manomissione • Crea ricevute transazioni e file «Ledger» serializzati contenenti informazioni che possono essere verificate dai clienti • Microsoft è fuori dalla «TCB», codice sorgente è open source (Confidential Consortium Framework)
  • 13. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Verifica del «Ledger» • Manomissione possibile a meno di modifiche impedite/tracciate • Es. modifica diretta file dati, DBCC WRITEPAGE, «hijacking» processo di SQL Server, ecc. • Verifica ricalcola tutti gli hash e li confronta con i «digest» • Operazione richiede uso intensivo di risorse • Verificare • quando necessario (es. sospetto manomissione, audit) • su base ricorrente (es. giornalmente, ogni ora) • Verifica tramite procedura di sistema dipende da modalità salvataggio • automatico: passando indirizzo storage • manuale: passando documento JSON con «Digest»
  • 14. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 «Ledger auditing» • Nuovi eventi SQL Audit • ENABLE LEDGER • Creazione tabelle (o conversione, non ancora supportata) • ALTER LEDGER • Eliminazione/cambio nome tabelle (non ancora supportati) • GENERATE LEDGER DIGEST • VERIFY LEDGER • LEDGER_OPERATION_GROUP
  • 16. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Selezione opzione «deployment»
  • 17. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Creazione Database
  • 18. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Configurazione «Ledger»
  • 19. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 «Digest Storage»
  • 22. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Limitazioni generali • Opzione a livello di database non può essere disabilitata • No conversione tabelle esistenti • No cambio di nome o spostamento di «schema» • No eliminazione dati tabelle di storico (tabelle aggiornabili) • Transazione può aggiornare solo (!) 200 tabelle • «Long-term backups» (LTR) non supportati • «Ledger» aggiornabili ereditano limitazioni tabelle temporali
  • 23. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Limitazioni di interoperabilità • Tabelle «In-memory» non supportate • No operazioni di SWITCH IN/OUT • No indici di tipo «Full-Text» • No indice «non-clustered rowstore» con «clustered columnstore» • No «Change Tracking» • No tabelle FILETABLE • No utilizzo API UPDATETEXT e WRITETEXT
  • 24. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Limitazioni schema • Numero massimo di colonne (sempre 1024) • Tabelle aggiornabili +4 colonne • Tabelle solo accodamento +2 colonne • Aggiunta solo di colonne «nullable» (senza WITH VALUES) • No eliminazione colonne, modifica limitata: • NULL/NOT NULL, lunghezza tipi a lunghezza variabile, SPARSE • «Collation» per tipi Unicode, se non cambia «code page» per gli altri • No tipi dato XML, FILESTREAM, SqlVariant e «user-defined» • Colonne «computed» solo deterministiche • No «Sparse Column Set»
  • 25. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Scenari per tabelle «Ledger» • In generale: quelli che necessitano solo della «Forward Integrity» • Sistema attendibile al processamento della transazione, protetto contro manomissioni future • Alcuni esempi • Semplificazione scenari di audit • Verifica crittografica manomissione dati verso terze parti (interne o esterne) • Processi aziendali tra più parti • Alternativa a «blockchain» per sistemi intrinsecamente centralizzati in ottica «trust, but verify» • Storage «off-chain» affidabile per interrogazioni dati «blockchain» • «Choosing an Azure ledger technology» • https://techcommunity.microsoft.com/t5/azure-sql/choosing-an-azure-ledger-technology/ba-p/2450502
  • 26. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Risorse • Announcement blog • https://aka.ms/sql-ledger-blog • Azure SQL Database ledger Documentation • https://aka.ms/sql-ledger-docs • Whitepaper • https://aka.ms/sql-ledger-whitepaper
  • 27. #CDays14 – Milano 25, 26 e 27 Febbraio 2014 Grazie! • Q&A