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

Delivering changes for databases and applications

Eduardo Piairo
November 04, 2017

Delivering changes for databases and applications

Talk presented @ NetPonto (04-11-2017)

Eduardo Piairo

November 04, 2017
Tweet

More Decks by Eduardo Piairo

Other Decks in Technology

Transcript

  1. ABOUT ME Deployment pipeline for databases @EdPiairo, #NetPonto @EdPiairo https://pt.linkedin.com/in/jesuspiairo

    [email protected] http://www.eduardopiairo.com/ Eduardo Piairo Friend of Redgate Operations Engineer DevOps Porto Founder
  2. AGENDA • Deployment pipeline • Database challenges • Deployment pipeline

    stages • Deployment pipeline scenarios • Final thoughts Delivering changes for databases and applications @EdPiairo, #NetPonto
  3. DEPLOYMENT PIPELINE Delivering changes for databases and applications Source Control

    Continuous Integration Continuous Delivery Database + Application @EdPiairo, #NetPonto
  4. DATABASE CHALLENGES Delivering changes for databases and applications • Database

    and application changes (most of the time) are handled differently • Database is not included in the pipeline (manual work) • Different deployment pipeline • Synchronization needed @EdPiairo, #NetPonto
  5. DATABASE CHALLENGES Delivering changes for databases and applications • Manual

    work … • Lack of traceability of database changes (changes history) • It’s the most expensive and risky work type • Prevent CI and CD utilization in their full extent • Promote the fear of changes @EdPiairo, #WinOps
  6. THE PROBLEM TO FIX Delivering changes for databases and applications

    Databases become a bottleneck in an agile delivery process @EdPiairo, #NetPonto
  7. THE VALUE OF AUTOMATION Delivering changes for databases and applications

    • Enable control over database development • Increase speed of response to change • 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 @EdPiairo, #NetPonto
  8. THE VALUE OF AUTOMATION Delivering changes for databases and applications

    Fearless database changes @EdPiairo, #NetPonto
  9. SOURCE CONTROL 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 SQL Script @EdPiairo, #NetPonto
  10. • State based solutions • How the database should be

    (declarative) • Migrations based solutions • How the database should change (imperative) MIGRATIONS VS STATE Delivering changes for databases and applications Migration Migration State Delta @EdPiairo, #NetPonto
  11. SCRIPTING GUIDELINES Delivering changes for databases and applications • One

    script, one operation type, one object (small batches) • Merge conflicts management • Patterns identification • File system scripts history search @EdPiairo, #NetPonto
  12. CONTINUOUS INTEGRATION Delivering changes for databases and applications • Integrate

    and validate changes • Tests: Unit, Integration • Small batches, less risk • Considerations: • What should be tested? And When? • Can the application help on this? @EdPiairo, #NetPonto
  13. CONTINUOUS DELIVERY Delivering changes for databases and applications • Delivering

    change(s) in the target environment • Considerations • Downtime • Time to recover • Affected applications @EdPiairo, #NetPonto
  14. FAILED DEPLOYMENT Delivering changes for databases and applications • Rollback/roll

    forward scripts • Very fast • Please, do not make mistakes • It’s like working backwards • Backups (before deploy) • Safer but slower • Keep databases small • Avoid share databases between applications @EdPiairo, #NetPonto
  15. SCENARIO #1 – INDEPENDENT PIPELINES Delivering changes for databases and

    applications Source Control Continuous Integration Continuous Delivery APP DB • Independent deployment pipelines • High need of synchronization between DBA and development team @EdPiairo, #NetPonto
  16. SCENARIO #2 – DELIVERING TOGETHER Delivering changes for databases and

    applications Source Control Continuous Integration Continuous Delivery APP DB • Different code repositories • Independent CI process • The contact point will be the deployment moment @EdPiairo, #NetPonto
  17. SCENARIO #3 – CONNECTED INTEGRATION Delivering changes for databases and

    applications Source Control Continuous Integration Continuous Delivery APP DB • Different code repositories • Connected/dependent CI process @EdPiairo, #NetPonto
  18. SCENARIO #4 – FULL INTEGRATION Delivering changes for databases and

    applications Source Control Continuous Integration Continuous Delivery APP DB • Share the some code repository, CI process and CD process • No need of synchronization • Promotes learning within teams (database code reviews) @EdPiairo, #NetPonto
  19. DEVOPS, DATABASES AND APPLICATIONS Delivering changes for databases and applications

    • Deployment pipeline: Cultural and technical tool for managing changes in the software development process (should contemplate databases, applications and infrastructure). • DevOps as a contract – collaboration and communication mechanism for change management • Bringing DevOps to the pipeline: • Increase flow visibility • Increase feedback • Increase knowledge base @EdPiairo, #NetPonto