Slide 1

Slide 1 text

DEPLOYMENT PIPELINE Eduardo Piairo Azure SQL Databases

Slide 2

Slide 2 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Eduardo Piairo Operations Engineer DevOps Porto Founder About me @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/

Slide 3

Slide 3 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline / flow / value stream Source Control Continuous Integration Continuous Delivery Database + Application

Slide 4

Slide 4 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES What’s so special about databases? The database challenge

Slide 5

Slide 5 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES The database challenge Databases became a bottleneck in an agile delivery process

Slide 6

Slide 6 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES The database challenge - The solution Source Control Continuous Integration Continuous Delivery Automation + Change control

Slide 7

Slide 7 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES The value of automation • Enable control over database development • Increase speed of response to change • Keep a versioned “history” of database states • Greater reliability of the release process • Remove/reduce human intervention in the release process From (Re)Learn and forget it to Improve and forget it

Slide 8

Slide 8 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Source Control – Change description • First step in your database deployment pipeline • Traceability through change history • SQL as documentation • Shared code-base and shared process • Enforceable standards to reduce conflicts • Fundamental resource: SQL script

Slide 9

Slide 9 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Source Control – Migrations vs State • State based solutions • Script represents the current database state • Your source of truth is how the database should be • Migrations based solutions • Script represents a migration • Migration represents how to transition to the next database version • Your source of truth is how the database should change SQL Source Control

Slide 10

Slide 10 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Continuous Integration – Change validation • Integrate and validate changes • Small batches • Unit, Integration, Acceptance tests • What tests should be done? • Before, during and after the deployment? • What happens if tests breaks? • Depends on what was broken, when was broken • Manual intervention, automation? • Rollback, roll front?

Slide 11

Slide 11 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Continuous Delivery – Change implementation • Delivering the change(s) in the target environment • Build once, deploy any (promote) • Deployment considerations • Time to recover • Small batches – low risk • Downtime • Affected applications

Slide 12

Slide 12 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Rollback • At what point did it fail? • What changed? • Do I have partially updated data? • Do I have partially objects changed? • How can I go back to the last known state? • Rollback database objects • Rollback the full database • Rollback scripts (or should I call roll front?) • Very fast • Do not make mistakes • Do I have partially objects changed? • Backups (before deploy) • Safer method • Slower deployments (database is down during deploy) • Keep databases small • Avoid share databases between applications

Slide 13

Slide 13 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Azure SQL Database • Relational database-as-a service • Keep your databases small and independent • You pay for each database • ARM templates • “Infrastructure” orchestration

Slide 14

Slide 14 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline – Scenario #1 Source Control Continuous Integration Continuous Delivery APP DB

Slide 15

Slide 15 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline – Scenario #2 Source Control Continuous Integration Continuous Delivery APP DB

Slide 16

Slide 16 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline – Scenario #3 Source Control Continuous Integration Continuous Delivery APP DB

Slide 17

Slide 17 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline – Scenario #4 Source Control Continuous Integration Continuous Delivery APP DB

Slide 18

Slide 18 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Deployment pipeline & DevOps • DevOps as a Contract – collaboration and communication mechanism for change management • Should be reflected in your deployment pipeline • The better/clearer your pipeline, the less you need to document (your code is your documentation) • Everything is negotiable in the contract, except its application

Slide 19

Slide 19 text

DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES Reading material

Slide 20

Slide 20 text

OPERATIONS FOR DATABASES Q&A @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/