Share
Embed
Delivering changes for applications and databases @ Azure
Talk presented @ PortoData (28-03-2017)
Eduardo Piairo
March 28, 2017
Transcript
39 slides
-
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Eduardo Piairo, DevOps Engineer
About me @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/ -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 1. The value stream
2. The problem to fix Chapter 1: Introduction -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 1. Create web app
Chapter 2: Application -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 1. Physical machines 2.
Virtual machines 3. Platform as a Service (PaaS) 4. Serverless 5. Infrastructure as Code (IaC) Chapter 3: Infrastructure -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 1. What’s so special
about databases 2. Database challenges 3. Why database automation 4. The 1st step: Source Control 5. Migrations vs State 6. Flyway 7. Version Control System Chapter 4: Database -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 1. Deployment pipeline 2.
The DevOps way Chapter 5: DevOps as engineering practice -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS The value stream Source
Control Continuous Integration Continuous Delivery Database + Application -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Database and application most
of the times are not both included in the value stream Have different deployment pipelines Database is not included in the deployment pipeline As result, database is out of pace with application development The problem to fix -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Databases becoming a bottleneck
in an agile delivery process The problem to fix -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Let’s create a web
app… Application -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS How can you have
the required consistency without including infrastructure? If you practice (development) and play (production) in different fields, why do you expect the same behavior/performance? Infrastructure -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS High hardware cost High
human cost Very low flexibility Physical machines -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS In the cloud Upfront
cost First step to IaC Requires configuration management Virtual machines -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Very flexible approach Costs
grow with the application Fast and simple development Bring infrastructure/operations closer to the development Platform-as-a-Service (PaaS) -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Azure Functions AWS Lambda
Pay what you use Serverless (FaaS) -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Thank you Virtualization!! Managing
and provisioning infrastructure Is not simply writing scripts Allows to apply proven software development practices Version control, testing, small deployments Infrastructure as Code (Iac) -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Databases are out of
pace with application development Lack of traceability of database changes (changes history) Manual databases processes prevent the CI and CD utilization Lack of testability Database setup time for new environments Bugs in production Database challenges -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Databases becoming a bottleneck
in an agile delivery process Database challenges -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Enable control over database
development Increase speed of response to change Keep a versioned “history” of database states and changes Reliability of the release process Increase release frequency though repeatability of processes Reduce time spent fixing bugs - automated tests Remove/reduce human intervention in the release process Why database automation -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 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 The 1st step: Source Control -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Fundamental resource The 1st
step: Source Control SQL Script -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS 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 Migrations vs State -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Flyway – “Database Migrations
made Easy” http://flywaydb.org/ Open source database migration tool Flyway command-line enabled Simplicity: easy to setup, no need to install Zero dependencies (java + jdbc) Scripts are written in SQL Flyway -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Flyway commands: migrate, clean,
info, validate, baseline, repair Metadata table: Used to track the state of the database If the database is empty, flyway won’t find it and will create it Flyway scans the migrations directory and check migrations against the metadata table Migrations are sorted based on their version number and applied in order Flyway: How it works -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Rule 1: Script version
(timestamp) Rule 2: Operation type Rule 3: Object type Rule 4: Object name Version Control System Example: V20170311.1200__Create_TB_MyTable.sql -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Devops: contract for collaboration
and communication (change management “framework”) Change description (Source Control) Change validation (Continuous Integration) Change implementation (Continuous Delivery) Applications, databases, infrastructure The DevOps way -
DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Q&A @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected]
http://www.eduardopiairo.com/