Agile Database Development with Liquibase

3,219 views

Published on

Learn to apply well-understood agile development practices to the database, using the open-source Liquibase tool to refactor your database schema in a controlled, incremental fashion.

Published in: Technology, Business
  • Be the first to comment

Agile Database Development with Liquibase

  1. 1. AGILE DATABASE DEVELOPMENT WITH Tim Berglund June, 2009
  2. 2. TIM BERGLUND
  3. 3. WE BELIEVE CODE CHANGES
  4. 4. WE BELIEVE CODE CHANGES
  5. 5. WE ACT LIKE THE DATABASE DOESN’T
  6. 6. WE ACT LIKE THE DATABASE DOESN’T
  7. 7. TERMINAL MALADAPTION
  8. 8. EMBALMING
  9. 9. WON’T DIE
  10. 10. NOT REALLY ALIVE
  11. 11. CURSES THE DBA WHO CHANGES IT
  12. 12. WE WILL BREAK THE CURSE
  13. 13. AGILE DATABASE DEVELOPMENT
  14. 14. Refactoring Evolutionary Automated Data Testing Modeling Agile Database Development Source Sandboxes Control
  15. 15. REFACTORING
  16. 16. REFACTORING
  17. 17. REFACTORING This term occasionally gets abused!
  18. 18. REFACTORING A disciplined way to make small changes to your source code to improve its design, making it easier to work with.
  19. 19. REFACTORING Not adding features!
  20. 20. REFACTORING Not fixing bugs!
  21. 21. REFACTORING Opportunistically improving design to accommodate change.
  22. 22. DATABASE REFACTORING A simple change to a database schema that improves its design while retaining both its behavioral and informational semantics.
  23. 23. EVOLUTIONARY DATA MODELING
  24. 24. EVOLUTIONARY DATA MODELING NOT TRYING TO “GET IT RIGHT UP FRONT.”
  25. 25. EVOLUTIONARY DATA MODELING MAYBE SOME BIG THOUGHTS AT FIRST
  26. 26. EVOLUTIONARY DATA MODELING BUILD THE SIMPLEST THING THAT CAN POSSIBLY WORK...EVERY DAY
  27. 27. DATABASE TESTS TDD IN THE DB
  28. 28. DATABASE TESTS
  29. 29. DATABASE TESTS STORED PROCEDURES
  30. 30. DATABASE TESTS STORED PROCEDURES SQLUNIT
  31. 31. DATABASE TESTS STORED PROCEDURES SQLUNIT DBUNIT
  32. 32. DATABASE TESTS STORED PROCEDURES SQLUNIT DBUNIT CUSTOM HYBRIDS
  33. 33. SOURCE CONTROL
  34. 34. SOURCE CONTROL LIKE MOTHER TAUGHT YOU
  35. 35. SOURCE CONTROL
  36. 36. SOURCE CONTROL DDL EXTRACT/MIGRATION SCRIPTS REFERENCE DATA STORED PROCS/TRIGGERS
  37. 37. SANDBOXES
  38. 38. COMMAND-LINE TOOL
  39. 39. COMMAND-LINE TOOL JAVA/JDBC
  40. 40. COMMAND-LINE TOOL JAVA/JDBC CROSS-PLATFORM
  41. 41. COMMAND-LINE TOOL JAVA/JDBC CROSS-PLATFORM ANT, MAVEN, SPRING, GRAILS
  42. 42. CHANGELOG
  43. 43. CHANGELOG COMMANDS
  44. 44. CHANGELOG COMMANDS MIGRATION SCENARIOS
  45. 45. CHANGELOG
  46. 46. CHANGELOG SQL IN XML
  47. 47. CHANGELOG SQL IN XML COHERENT GROUPS OF OPERATIONS
  48. 48. CHANGELOG SQL IN XML COHERENT GROUPS OF OPERATIONS TRACKED IN DATABASE
  49. 49. CHANGELOG <changeSet author="tlberglund (generated)" id="1236660747556-11"> <createTable tableName="scshoppingcart"> <column autoIncrement="true" name="id" type="INT"> <constraints nullable="false"/> </column> <column name="userid" type="INT"> <constraints nullable="false"/> </column> <column name="lastmodified" type="DATETIME"/> <column name="name" type="VARCHAR(50)"/> </createTable> </changeSet> <changeSet author="tlberglund" id="spot-1-1-2"> <renameTable oldTableName="scscrubrecordwarehouse" newTableName="scrub_record_log" /> </changeSet>
  50. 50. LIQUIBASE COMMANDS
  51. 51. LIQUIBASE COMMANDS generateChangeLog
  52. 52. LIQUIBASE COMMANDS changeLogSync
  53. 53. LIQUIBASE COMMANDS update
  54. 54. LIQUIBASE COMMANDS tag
  55. 55. LIQUIBASE COMMANDS rollback
  56. 56. LIQUIBASE COMMANDS diff
  57. 57. DEMO
  58. 58. AND WE’RE BACK
  59. 59. Refactoring Evolutionary Automated Data Testing Modeling Agile Database Development Source Sandboxes Control
  60. 60. CULTIVATING THE BROWNFIELD
  61. 61. LEGACY ENTERPRISE APP
  62. 62. NEW GRAILS HOTNESS
  63. 63. HARD CUTOVER
  64. 64. CREATIVE ORM MAPPINGS
  65. 65. WITHERING ON THE VINE
  66. 66. BROWNFIELD DATA INTEGRATION
  67. 67. BROWNFIELD DATA INTEGRATION TIME ZERO MIGRATION
  68. 68. BROWNFIELD DATA INTEGRATION TIME ZERO MIGRATION
  69. 69. BROWNFIELD TESTING
  70. 70. BROWNFIELD TESTING INTEGRATION TEST DATA
  71. 71. BROWNFIELD TESTING
  72. 72. BROWNFIELD TESTING T0 MIGRATION SCRIPTS
  73. 73. BROWNFIELD TESTING
  74. 74. THE CURSE IS BROKEN
  75. 75. THANK YOU! TIM BERGLUND AUGUST TECHNOLOGY GROUP, LLC http://www.augusttechgroup.com tim.berglund@augusttechgroup.com @tlberglund
  76. 76. PHOTO CREDITS HAMMER SHATTERING GLASS: HTTP://WWW.FLICKR.COM/PHOTOS/WHISPERWOLF/3486270713 DODO: HTTP://WWW.INTERNATIONALDOVESOCIETY.COM/MISCSPECIES/DODO.HTM EMBALMING: HTTP://LIBRARY.THINKQUEST.ORG/C0116982/HTML%20PAGE%20FOLDER/ HMUMMIFICATION.HTM ATTACKING MUMMY: HTTP://WWW.FLICKR.COM/PHOTOS/ROONBABOON/292393932/ CREEPY MUMMY HEAD: HTTP://WWW.FLICKR.COM/PHOTOS/DR-INI/446311713/ MARTIN FOWLER: HTTP://WWW.FLICKR.COM/PHOTOS/PRAGDAVE/173640462/ SCOTT AMBLER: HTTP://WWW.AMBYSOFT.COM/SCOTTAMBLER.HTML BRENDEN FRASER: HTTP://SCRAPETV.COM/NEWS/NEWS%20PAGES/ENTERTAINMENT/UNIVERSAL-FIRE- ACCIDENTAL-NEW-MUMMY-MOVIE-DELIBERATE-SCRAPE-TV-THE-WORLD-ON-YOUR-SIDE.HTML SAND: HTTP://WWW.FLICKR.COM/PHOTOS/LEVIATHOR/207625319/ MOTHER AND CHILD: HTTP://WWW.FLICKR.COM/PHOTOS/PATRICK_Q/268149208/ BROWN FIELD: HTTP://WWW.FLICKR.COM/PHOTOS/ARTUR02/471094378/ JALOPY: HTTP://WWW.FLICKR.COM/PHOTOS/DRAGONFLEYE/3246153/ JALOPY ON RT 66: HTTP://WWW.FLICKR.COM/PHOTOS/EVOETSCH/2436023218/ PIMPMOBILE: HTTP://WWW.FLICKR.COM/PHOTOS/AIRGAP/1053594933/ JUNKED JALOPY: HTTP://WWW.FLICKR.COM/PHOTOS/JABOOBIE/61014658/ PAINTING CAR: HTTP://WWW.FLICKR.COM/PHOTOS/GARETHJMSAUNDERS/2066690016/

×