Database migration in net
This presentation is the property of its rightful owner.
Sponsored Links
1 / 57

Database Migration in .NET PowerPoint PPT Presentation


  • 67 Views
  • Uploaded on
  • Presentation posted in: General

Database Migration in .NET. Continuous Database Evolution. story. 3. Claire Bennet : Database Administrator + Neat freak + Former cheerleader. Hiro Nakamura: Software developer + Haphazard + Addicted to manga. Mohinder Suresh:

Download Presentation

Database Migration in .NET

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Database migration in net

Database Migration in .NET

Continuous Database Evolution


Story

story


Database migration in net

3


Database migration in net

Claire Bennet:

Database Administrator + Neat freak + Former cheerleader


Database migration in net

Hiro Nakamura:

Software developer + Haphazard + Addicted to manga


Database migration in net

Mohinder Suresh:

Software tester (PhD) + Detail-oriented + Efficiency expert


Chapter 1 hiro s bad day

Chapter 1: Hiro’s Bad Day


Meet claire

meet Claire:


Database migration in net

Hi!


Database migration in net

I’m just finishing this SSIS package


Database migration in net

Sure!


Database migration in net

Strange. It used to work.


Database migration in net

Can you come back in 5 minutes?


45 minutes later

45 minutes later:


Database migration in net

HIRO!!!


Database migration in net

Wha??


1 hour earlier

1 hour earlier:


Database migration in net

There’s gotta be a way to make this more generic


Database migration in net

I’ll just update the shared database to be more consistent with the domain model


Database migration in net

It will be fine...


Back in the present

back in the present:


Database migration in net

DOH! Stupid shared database


Meanwhile

meanwhile:


Database migration in net

Hiro! I just upgraded the test database with that script that you gave me last week, but it doesn’t seem to be working. How do I know if the script has been applied correctly?


Database migration in net

If only I could go back in time and fix this...


Database migration in net

There has to be better way...


What problems did you see

what problems did you see?


My list

my list


Changes to shared database are immediately available to everyone

#1

Changes to shared database are immediately available to everyone

(whether they want them or not)


Claire couldn t easily see what had changed to the database

#2

Claire couldn’t easily see what had changed to the database


Suresh was applying database scripts one week after they were available

#3

Suresh was applying database scripts one week after they were available


Hiro had no way to see if database changes were applied successfully

#4

Hiro had no way to see if database changes were applied successfully


How would you solve this

how would you solve this?


My prescriptions

my prescriptions:


C hanges to shared database a re immediately available to everyone

Changes to shared database are immediately available to everyone

(whether they want them or not)

Separate database instances


Claire couldn t easily see what had changed to the database1

Claire couldn’t easily see what had changed to the database

All database changes are under sourcecontrol


Suresh was applying database scripts one week after they were available1

Suresh was applying database scripts one week after they were available

Automate database migration


Hiro had no way to see if database changes were applied successfully1

Hiro had no way to see if database changes were applied successfully

Version all database changes


Database migration in net

THANKS!!


Chapter 2 tools

Chapter 2: Tools


Database migration in net

dbDeploy.NET*

http://dbdeploy.com


Database migration in net

Tarantino

  • http://code.google.com/p/tarantino/


Database migration in net

Migrator.NET

  • http://code.google.com/p/migratordotnet/


Database migration in net

immature


Database migration in net

enough slides already...


Database migration in net

show me the code


Database migration in net

dbDeploy.NET

Pro:

Con:

  • Simple

  • Supports SqlServer, Oracle, Sybase, HSQL, MySql

  • DBA-friendly

  • Needs better dev environment support


Database migration in net

Tarantino

Pro:

Con:

  • Easy to get started

  • Automates most dev db tasks

  • No control over version numbers

  • SQL Server-specific

  • Rebaselining?

  • Requires NAnt


Database migration in net

Migrator.NET

Pro:

Con:

  • Easy to get started

  • Cross-database support

  • Supports SqlServer, Oracle, MySql, Postgres

  • Data migration

  • Developer-specific

  • No way to easily capture SQL


Agile vancouver conference

Agile Vancouver Conference

November 4-6, 2008


Questions

Questions?


Database migration in net

  • Background:

    • database scripts in sourcecontrol

    • database instances per developer

  • SqlServer generate scripts

    • what happens after version 1.0

    • what version is this anyway?

  • SqlCompare – take a look

  • version table

  • dbDeploy.net – up and down

  • Tarantino

  • Rails migrations

    • multi-database support (ie in-memory db for integration tests)

    • DSL for database update

    • data migration support

  • what is migrated?

  • in example migrate database containing data (use Northwind)

  • rebaselining

  • managing branches


Database migration in net

  • dbDeploy.net

    • goal: automate the creation of delta script

    • production focused: hand off to production DBA

      • database migration for most organizations is not automated

    • supported DBs: SqlServer, Oracle, Sybase, MySql, HSql

    • version table: changelog (configurable)

    • versioning: derived from filename

    • does three things:

      • 1) determine which scripts have to be applied

      • 2) increment version for application of each script

      • 3) merge all scripts into a single script


Database migration in net

  • Tarantino

    • goal: automate database creation and upgrade

    • development focus: easily automatable for as part of build process

      • database migration for most organizations is not automated

    • version table: usd_

    • version=# of executed scripts – rebaselining?


Database migration in net

  • Migrator.NET

    • goal: leverage Rails-style migrations in .NET

    • cross-database migration support

    • leverage domain objects for persistence

    • version table: SchemaInfo


  • Login