Slide 1

Slide 1 text

DELIVERING CHANGES FOR DATABASES AND APPLICATIONS Eduardo Piairo @EdPiairo #NetPonto

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

AGENDA • Deployment pipeline • Database challenges • Deployment pipeline stages • Deployment pipeline scenarios • Final thoughts Delivering changes for databases and applications @EdPiairo, #NetPonto

Slide 4

Slide 4 text

DEPLOYMENT PIPELINE Delivering changes for databases and applications Source Control Continuous Integration Continuous Delivery Database + Application @EdPiairo, #NetPonto

Slide 5

Slide 5 text

WHAT’S SO SPECIAL ABOUT DATABASES? Delivering changes for databases and applications @EdPiairo, #NetPonto

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

THE PROBLEM TO FIX Delivering changes for databases and applications Databases become a bottleneck in an agile delivery process @EdPiairo, #NetPonto

Slide 9

Slide 9 text

AUTOMATION Delivering changes for databases and applications @EdPiairo, #NetPonto

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

THE VALUE OF AUTOMATION Delivering changes for databases and applications Fearless database changes @EdPiairo, #NetPonto

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

• 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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

CONTINUOUS DELIVERY Delivering changes for databases and applications • Delivering change(s) in the target environment • Considerations • Downtime • Time to recover • Affected applications @EdPiairo, #NetPonto

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

DEMO Delivering changes for databases and applications @EdPiairo, #NetPonto

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

READING MATERIAL Delivering changes for databases and applications @EdPiairo, #NetPonto

Slide 25

Slide 25 text

Q&A Delivering changes for databases and applications @EdPiairo https://pt.linkedin.com/in/jesuspiairo [email protected] http://www.eduardopiairo.com/ @EdPiairo, #NetPonto