View
6
Download
0
Category
Preview:
Citation preview
Agilex www.agilex.com
Topics in Database Version Control
Dominic Delmolino
Agilex www.agilex.com
Dominic Delmolino ! Oracle database technologist / engineer since 1990 ! Former
! Member of Oracle’s System Performance Group ! CTO of Savant CorporaDon ! Director of Database Engineering at Network SoluDons
! Current ! Member of OakTable ! Oracle Ace ! Vice President of Database Architecture and Engineering, Agilex Technologies
! Social ! Blog at OracleMusings.com (infrequently) ! @ddelmoli on TwiSer
! Author ! Strategies and Techniques for Oracle ReplicaDon (1995) ! Chapter on Parallel PL/SQL programming in Expert PL/SQL PracDces
! CerDficaDons ! Oracle Exadata CerDfied ImplementaDon Specialist ! Cloudera CerDfied Developer for Apache Hadoop
Agilex www.agilex.com
Sync vs. Directed Applica:on
! Sync – Uses a reference model and diff process
! Directed ApplicaDon – Uses a changeset model and directed scripDng
Agilex www.agilex.com
Central vs. Distributed
! Central Database – all developers work against a single instance
! Distributed – all developers work against a private “database”
! Hybrid ! Private schemas ! Private Pluggable Databases (12c)
Agilex www.agilex.com
Reference and Volume Data Management
! Reference Data ! Similar to Sync vs. Directed ApplicaDon problem
! Data Volume ! StaDsDcs, plans, good queries vs. bad queries
Agilex www.agilex.com
Trends in SCM / CI
! Git vs. Subversion ! Code Reversion ! TDD
Agilex www.agilex.com
Shared (Central) vs. Private (Distributed)
! Central ! Pros
! Easy to share load and reference data ! “Immediate” integraDon J ! Visibility by DBAs into poor code
! Cons ! Locking ! PotenDally deferred SCM ! Breakage
Agilex www.agilex.com
Shared (Central) vs. Private (Distributed)
! Distributed ! Pros
! Private sandbox for tesDng ! No locking ! Same connecDon string for all developers
! Cons ! Need good CI / SCM process ! Limited data ! Limited oversight / guidance capability
Agilex www.agilex.com
Shared (Central) vs. Private (Distributed)
! Private Schemas ! Pros
! Private sandbox for tesDng ! No locking ! Oversight capability
! Cons ! Different connecDon strings for each developer ! Need good CI ! Limited data ! Schema name proliferaDon may limit branching capabiliDes
Agilex www.agilex.com
Shared (Central) vs. Private (Distributed)
! Pluggable Databases ! Pros
! Private sandbox for tesDng ! No locking ! Oversight capability
! Cons ! Different connecDon strings for each developer (but schema names can be the same)
! Need good CI ! Limited data
Agilex www.agilex.com
Sync vs. Directed Applica:on
! Sync ! Comments
! Based on “diff’ing” reference model with current model ! Some ORM tools do this (i.e., Hibernate verify)
! Pros ! Good tooling based on exisDng schema diff tools (i.e., Schema Compare for Oracle, Source Code Control for Oracle)
! Easy to create / maintain a reference PDM ! Cons
! Limited control over how to apply changes ! Limited rollback capabiliDes
Agilex www.agilex.com
Directed Applica:on
! Directed ApplicaDon ! Comments
! Developers write code to apply changes to a schema ! Called changesets (liquibase), migraDons (ruby) or refactoring scripts
! Pros ! Good for tracking who did what when and why ! More opDons for rollback ! More control over how change is applied ! Slightly beSer integraDon with CI tools
! Cons ! Hard to maintain a reference PDM ! Not as good for full rebuilds ! Limited, unfamiliar tooling
Agilex www.agilex.com
Trends in SCM
! My background is with SCCS and older tools ! SVN ! Git
! GitHub / Bitbucket popularity ! Rise of distributed version control ! Local workspaces
! Full stack copy of environment for every developer
! Local repository
Agilex www.agilex.com
Reference Data
! Data as Code ! Controlled via SCM ! Would be nice if dbDoc type generators could produce reference data output as well
Agilex www.agilex.com
Reversion
! How do we revert database code? ! More importantly, how do we test DDL changes before deploying them?
Agilex www.agilex.com
TDD
! Can DDL be TDD’d? ! Rule asserDons like those in SQL Developer Data Modeler
! Naming standards? ! Standard abbreviaDon list?
Agilex www.agilex.com
Branching
! Can this be used to do TDD? ! Local vs. origin vs. master? ! Schema_Name[suffix]
! MulDple copies of the schema ! Suffix maps to a branch name? ! Reference schema from ERD Model? ! Local work schema ! “Official” schema
Agilex www.agilex.com
Building
! CI process that produces success / failure indicators
! Temporary build workspaces and arDfacts ! JPA generaDon? camelCase vs. column name vs. standard abbreviaDons?
Agilex www.agilex.com
QuesDons? Dominic Delmolino Dominic.Delmolino@Agilex.com @ddelmoli
Recommended