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

You Version Your Code, Why Not Your Database?

derek-b
January 10, 2020

You Version Your Code, Why Not Your Database?

Code versioning is an integral part of any developers daily workflow. However, database changes are often handled manually making automatic code deploys a challenge. If something goes wrong, rolling back a deployment requires either complex and possibly untested scripts or a database restore.

Adding database versioning to your development environment will help you solve these issues. In the talk you will see examples of using Liquibase to manage database changes. You will learn how scripting and versioning your database structures will allow easy, scripted deployments that can be repeated by developers, in QA, and in prod. Once you see the ease at which you can deploy database changes, you will wonder how you ever got along without it.

derek-b

January 10, 2020
Tweet

More Decks by derek-b

Other Decks in Technology

Transcript

  1. @DerekB_WI 11 NPM Packages such as db-migrate available for Node

    Doctrine PHP based database tools, includes migrations LARAVEL Migrations built into PHP framework PHINX PHP Any framework FLYWAY Java, Maven, Gradle LIQUIBASE Java DATABASE VERSIONING
  2. @DerekB_WI 23 Instant Setup Code, plus database from git Database

    Defined Your migrations completely define your database. Really? Can it capture everything for us?
  3. @DerekB_WI 28 Code Changes We may have modified the database

    Keep Track of DDL? Over the course of a feature build you may not have kept an accurate change file
  4. @DerekB_WI 38 AWS Maven Ant Spring Liquibase can integrate with

    common build tools or frameworks Workflow Integration
  5. @DerekB_WI 39 Direct Access Deployment Server can contact Database Deployment

    Server Deployment could be running directly from deployment machine Deployment Scenario 2 3 1
  6. @DerekB_WI 40 Firewall Blocked Deployment Server cannot access database App

    Server Deployment sends message to application server to run migration Deployment Scenario
  7. @DerekB_WI 42 Other Changes addAutoIncrement addColumn addDefaultValue addForeignKeyConstraint addLookupTable addNotNullConstraint

    addPrimaryKey addUniqueConstraint alterSequence createIndex createProcedure createSequence createTable createView customChange delete dropAllForeignKeyConstraints dropIndex dropNotNullConstraint dropPrimaryKey dropProcedure dropSequence dropTable dropUniqueConstraint dropView empty executeCommand insert loadData loadUpdateData mergeColumns modifyDataType output renameColumn renameTable renameView setColumnRemarks setTableRemarks sql sqlFile stop tagDatabase update