Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Delivering changes for databases and applications

Delivering changes for databases and applications

Talk presented @ SQLSaturday Lisbon 2017 (11-03-2017)

7b47fb5bb7f32e0ffdbd7bba5598ba98?s=128

Eduardo Piairo

March 11, 2017
Tweet

Transcript

  1. Delivering changes for databases and applications Eduardo Piairo

  2. Delivering changes for databases and applications Eduardo Piairo, DevOps Engineer

    3/6/2018 | 2 | @EdPiairo https://pt.linkedin.com/in/jesuspiairo eduardopiairo@outlook.com http://www.eduardopiairo.com/
  3. Chapter 1: Introduction 1. The value stream 2. The problem

    to fix
  4. Chapter 2: Application 1. Create a web app

  5. Chapter 3: Infrastructure 1. Physical machines 2. Virtual machines 3.

    Platform as a Service (PaaS) 4. Serverless 5. Infrastructure as Code (IaC)
  6. Chapter 4: Database 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
  7. Chapter 5: DevOps as engineering practices 1. Deployment pipeline 2.

    The DevOps way
  8. Chapter 1: Introduction Delivering changes for databases and applications

  9. The value stream Source Control Continuous Integration Continuous Delivery Database

    + Application
  10. The problem to fix 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
  11. The problem to fix Databases becoming a bottleneck in an

    agile delivery process
  12. Chapter 2: Application Delivering changes for databases and applications

  13. Application: the logical world Let’s create a web app…

  14. Chapter 3: Infrastructure Delivering changes for databases and applications

  15. Infrastructure 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?
  16. Physical machines High hardware cost High human cost Very low

    flexibility
  17. Virtual machines In the cloud Upfront cost First step to

    IaC Requires configuration management
  18. Platform as a Service (PaaS) Very flexible approach Costs grow

    with the application Fast and simple development Bring infrastructure/operations closer to the development
  19. Platform as a Service (PaaS) Azure Functions AWS Lambda Pay

    what you use
  20. Infrastructure as Code (IaC) Thank you Virtualization!! Managing and provisioning

    infrastructure Is not simply writing scripts Allows to apply proven software development practices Version control, testing, small deployments
  21. Chapter 4: Database Delivering changes for databases and applications

  22. What’s so special about the database

  23. What’s so special about the database

  24. Database challenges 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
  25. Database challenges Databases becoming a bottleneck in an agile delivery

    process
  26. Database challenge

  27. Why database automation 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
  28. Why database automation Fearless databases changes

  29. The 1st step: Source Control 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
  30. The 1st step: Source Control Fundamental resource: SQL Script

  31. 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
  32. Flyway 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
  33. Flyway – How it works 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
  34. Version Control System Rule 1: Script version (timestamp) Rule 2:

    Operation type Rule 3: Object type Rule 4: Object name Example: V20170311.1200__Create_TB_MyTable.sql
  35. Demo

  36. Chapter 5: DevOps as engineering practices Delivering changes for databases

    and applications
  37. Deployment pipeline

  38. The DevOps Way Devops: contract for collaboration and communication (change

    management “framework”) Change description (Source Control) Change validation (Continuous Integration) Change implementation (Continuous Delivery) Applications, databases, infrastructure
  39. Reading material Delivering changes for databases and applications

  40. Reading material

  41. Delivering changes for databases and applications 3/6/2018 | 41 |

    @EdPiairo https://pt.linkedin.com/in/jesuspiairo eduardopiairo@outlook.com http://www.eduardopiairo.com/