DEPLOYMENT PIPELINE Eduardo Piairo
Azure SQL Databases
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Eduardo Piairo
Operations Engineer
DevOps Porto Founder
About me
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@gmail.com
http://www.eduardopiairo.com/
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Deployment pipeline / flow / value stream
Source
Control
Continuous
Integration
Continuous
Delivery
Database
+
Application
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
What’s so special about databases?
The database challenge
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
The database challenge
Databases became a bottleneck in an
agile delivery process
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
The database challenge - The solution
Source
Control
Continuous
Integration
Continuous
Delivery
Automation
+
Change control
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
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
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
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?
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
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
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
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Deployment pipeline – Scenario #1
Source Control Continuous Integration Continuous Delivery
APP
DB
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Deployment pipeline – Scenario #2
Source Control Continuous Integration Continuous Delivery
APP
DB
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Deployment pipeline – Scenario #3
Source Control Continuous Integration Continuous Delivery
APP
DB
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Deployment pipeline – Scenario #4
Source Control Continuous Integration Continuous Delivery
APP
DB
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
DEPLOYMENT PIPELINE FOR AZURE SQL DATABASES
Reading material
OPERATIONS FOR DATABASES
Q&A
@EdPiairo
https://pt.linkedin.com/in/jesuspiairo
eduardopiairo@gmail.com
http://www.eduardopiairo.com/

Deployment pipeline for Azure SQL Databases

  • 1.
    DEPLOYMENT PIPELINE EduardoPiairo Azure SQL Databases
  • 2.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Eduardo Piairo Operations Engineer DevOps Porto Founder About me @EdPiairo https://pt.linkedin.com/in/jesuspiairo eduardopiairo@gmail.com http://www.eduardopiairo.com/
  • 3.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Deployment pipeline / flow / value stream Source Control Continuous Integration Continuous Delivery Database + Application
  • 4.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES What’s so special about databases? The database challenge
  • 5.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES The database challenge Databases became a bottleneck in an agile delivery process
  • 6.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES The database challenge - The solution Source Control Continuous Integration Continuous Delivery Automation + Change control
  • 7.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 8.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 9.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 10.
    DEPLOYMENT PIPELINE FORAZURE 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?
  • 11.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 12.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 13.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 14.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Deployment pipeline – Scenario #1 Source Control Continuous Integration Continuous Delivery APP DB
  • 15.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Deployment pipeline – Scenario #2 Source Control Continuous Integration Continuous Delivery APP DB
  • 16.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Deployment pipeline – Scenario #3 Source Control Continuous Integration Continuous Delivery APP DB
  • 17.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Deployment pipeline – Scenario #4 Source Control Continuous Integration Continuous Delivery APP DB
  • 18.
    DEPLOYMENT PIPELINE FORAZURE 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
  • 19.
    DEPLOYMENT PIPELINE FORAZURE SQL DATABASES Reading material
  • 20.