L Migrator Pres

1,040 views
973 views

Published on

Why are migrations important? This session will discuss how to put your databases on version control. The presentation is based on the assumption that the developer already knows about version control and is using it on their projects in some form. L-Migrator will be discussed in relation to its integration into PageBlocks and its stand alone use. Attendees will come away with a knowledge of the methodology behind migrations, why they are important and when to use them, as well as shortcuts and tips for writing Lasso Migrations and the dangers of performing destructive migrations.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,040
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

L Migrator Pres

  1. 1. L-MIGRATOR BRINGING DATABASE MIGRATIONS TO LASSO BRIAN LOOMIS LASSO DEVELOPER CONFERENCE CHICAGO 2008
  2. 2. GLUEWARE WHAT’S IN BOISE? HEWLETT PACKARD, MICRON. FOUNDED 9 YEARS AGO, BOISE IDAHO. -1999 SCRIPTING APPLESCRIPT, FILEMAKER, LASSO, ADOBE INDESIGN SERVER. ADOBE PARTNER, APPLE CONSULTANTS NETWORK, LPA.
  3. 3. WHAT ARE MIGRATIONS?
  4. 4. A MIGRATION
  5. 5. PLAN DRIVEN CYCLES MINIMIZE CHANGES EXTENSIVE UP-FRONT WORK WATERFALL APPROACH RUN INTO TROUBLE IF REQUIREMENTS ARE CHANGING REQUIREMENTS CHURN IS A BIG PROBLEM FOR SUCH PROCESSES
  6. 6. AGILE DEVELOPMENT LOVES CHANGE ALLOWING CHANGES TO OCCUR EVEN LATE IN A DEVELOPMENT PROJECT ATTITUDE OF THE PROCESS IS TO ENABLE CHANGE AS MUCH AS POSSIBLE RESPONSE TO THE INHERENT INSTABILITY OF REQUIREMENTS IN MANY PROJECTS BETTER SUPPORT DYNAMIC BUSINESS ENVIRONMENTS
  7. 7. A DIFFERENT ATTITUDE TO DESIGN INSTEAD OF THINKING OF DESIGN AS A PHASE - YOU LOOK AT DESIGN AS AN ON-GOING PROCESS INSTEAD OF THE COMMON CHAOS ALLOW EVOLUTIONARY DESIGN TO WORK IN A CONTROLLED MANNER PROVIDE TECHNIQUES TO CONTROL EVOLUTIONARY DESIGN AND MAKE THEM PRACTICAL
  8. 8. ITERATIVE DEVELOPMENT RUN THE ENTIRE SOFTWARE LIFE-CYCLE MANY TIMES DURING THE LIFE OF A PROJECT COMPLETING THE ITERATION WITH WORKING, TESTED, INTEGRATED CODE FOR A SMALL SUBSET OF THE REQUIREMENTS OF THE FINAL PRODUCT OTHER SPEAKERS...
  9. 9. HOW TO MAKE EVOLUTIONARY DESIGN WORK FOR DATABASES COMPLETING THE ITERATION WITH WORKING, TESTED, INTEGRATED CODE SMALL SUBSET OF THE REQUIREMENTS OF THE FINAL PRODUCT THESE ITERATIONS ARE SHORT, USUALLY RUNNING BETWEEN A WEEK AND A COUPLE OF MONTHS
  10. 10. TENETS OF AGILE METHODS PEOPLE WITH DIFFERENT SKILLS AND BACKGROUNDS NEED TO COLLABORATE VERY CLOSELY TOGETHER CAN'T COMMUNICATE MAINLY THROUGH FORMAL MEETINGS AND DOCUMENTS RECOGNIZES THAT PEOPLE LEARN BY TRYING THINGS OUT EACH DEVELOPER TO HAVE THEIR OWN SANDBOX
  11. 11. ALL CHANGES ARE DATABASE REFACTORINGS THREE DIFFERENT CHANGES THAT HAVE TO BE DONE TOGETHER: 1) CHANGING THE DATABASE SCHEMA 2) MIGRATING THE DATA IN THE DATABASE 3) CHANGING THE DATABASE ACCESS CODE
  12. 12. AUTOMATE THE REFACTORINGS DATABASE REFACTORING IS AUTOMATED BY WRITING IT IN THE FORM OF SQL DDL (FOR THE SCHEMA CHANGE) DML (FOR THE DATA MIGRATION)
  13. 13. UPDATE ALL DATABASE DEVELOPERS AUTOMATICALLY UPDATE EVERYONE ON THE PROJECT WHENEVER A CHANGE IS MADE TO THE DATABASE MASTER. SAME REFACTORING SCRIPT THAT UPDATES THE MASTER AUTOMATICALLY UPDATES EVERYONE'S DATABASE
  14. 14. CLEARLY SEPARATE ALL DATABASE ACCESS CODE IT'S IMPORTANT TO BE ABLE TO SEE HOW THE DATABASE IS USED BY THE APPLICATION IT MINIMIZES THE AREAS WHERE DEVELOPERS NEED SQL KNOWLEDGE LIFE EASIER TO DEVELOPERS NOT SKILLED WITH SQL FOR THE DBA IT PROVIDES A CLEAR SECTION TO SEE HOW THE DATABASE IS BEING USED HELPS WITH INDEXES, OPTIMIZATION, AND TO SEE HOW TO BE REFORMULATED TO PERFORM BETTER
  15. 15. TOOLS TO HELP DOING THIS KIND OF THING REQUIRES A LOT OF REPETITIVE TASKS. WE DO NOT LIKE REPETITIVE TASKS.
  16. 16. ENTER L-MIGRATOR LOVES CHANGE SUPPORT DYNAMIC BUSINESS ENVIRONMENTS PEOPLE LEARN BY TRYING THINGS EACH DEVELOPER HAS THEIR OWN SANDBOX
  17. 17. WHAT ARE MIGRATIONS ? KEEP HOLD OF THESE SCRIPT FILES TO PRODUCE A COMPLETE CHANGE LOG OF ALL THE ALTERATIONS DONE TO THE DATABASE UPDATE ANY DATABASE INSTANCE TO THE LATEST MASTER BY RUNNING THE CHANGE LOG SEQUENCE AUTOMATED CHANGES IS AN ESSENTIAL TOOL AS WELL AS AUTOMATING THE FORWARD CHANGES, YOU CAN CONSIDER AUTOMATING REVERSE CHANGES FOR EACH REFACTORING
  18. 18. INSTALLING L-MIGRATOR FILE EXTENSIONS SETUP PANEL TO ALLOW LASSO TO PROCESS .CTYP, .DSP, .CNFG AND .LGC FILES. COPY THE /DBM/ FOLDER (IT STANDS FOR DATABASE MIGRATOR) INTO YOUR WEB APPLICATION’S ROOT FOLDER. OPEN THE MIGRATOR.CNFG FILE AND EDIT THE THREE CONFIGURATION LINES. YOU SHOULD BE ABLE TO LOAD THE L-MIGRATOR PAGE AT YOUR ROOT DOMAIN /DBM/MIGRATOR.LASSO.
  19. 19. WRITING MIGRATIONS SCRIPTS TYPE NAME SHOULD MATCH FILE NAME (NO EXTENSION)
  20. 20. WRITING MIGRATIONS SCRIPTS TYPE NAME SHOULD MATCH FILE NAME (NO EXTENSION)
  21. 21. WRITING MIGRATIONS SCRIPTS TYPE NAME SHOULD MATCH FILE NAME (NO EXTENSION)
  22. 22. WRITING MIGRATIONS SCRIPTS TYPE NAME SHOULD MATCH FILE NAME (NO EXTENSION)
  23. 23. WRITING MIGRATIONS SCRIPTS UPDATE TAG SHOWS FORWARD CHANGES
  24. 24. WRITING MIGRATIONS SCRIPTS UPDATE TAG SHOWS FORWARD CHANGES
  25. 25. WRITING MIGRATIONS SCRIPTS UPDATE TAG SHOWS FORWARD CHANGES
  26. 26. WRITING MIGRATIONS SCRIPTS ROLL BACK TAG SHOWS ROLLBACKS OR UNDOS
  27. 27. WRITING MIGRATIONS SCRIPTS ROLL BACK TAG SHOWS ROLLBACKS OR UNDOS
  28. 28. WRITING MIGRATIONS SCRIPTS ROLL BACK TAG SHOWS ROLLBACKS OR UNDOS
  29. 29. WRITING MIGRATIONS SCRIPTS
  30. 30. WRITING MIGRATIONS SCRIPTS
  31. 31. WRITING MIGRATIONS SCRIPTS
  32. 32. MIGRATION COMMANDS
  33. 33. MIGRATION COMMANDS
  34. 34. TYPES OF MIGRATIONS COMMANDS ADDTABLE, REMOVETABLE, RENAMETABLE ADDFIELD, RENAMEFIELD, REMOVEFIELD, MODIFYFIELD ADDINDEX, REMOVEINDEX EXECUTE
  35. 35. EXAMPLES OF REAL MIGRATIONS OPEN TEXT EDITOR FOOL!
  36. 36. COMMON GUIDELINES TEST YOUR MIGRATIONS NEVER EDIT A RELEASED MIGRATION KEEP THEM SHORT AND SWEET BE MIGRATION DRIVEN
  37. 37. BE MIGRATION DRIVEN AS A DEVELOPER WRITING SHORT LINES OF CODE IS EASIER THAN FIRING UP AN EXTERNAL APP, MAKING CHANGES, SAVING THEM ETC. PLUS! YOU HAVE TO WRITE THE MIGRATION CODE LATER ANYWAYS. HOW MANY TIMES HAVE YOU EMAILED OR DOWNLOADED AN SQL FILE?
  38. 38. LETS LOOK AT SOME MIGRATION SCENARIOS
  39. 39. MIGRATIONS UNDER VERSION CONTROL SHOW EXAMPLES LOCATION AT GITHUB. HTTP://GITHUB.COM/DJDARKBEAT/L-MIGRATOR/TREE/MASTER YADA YADA.
  40. 40. CONCLUSION AND BIGGER PICTURE MIGRATIONS ARE YOUR FRIENDS END CRAZY DATABASE REFACTORINGS CREATE WAYS TO MANAGE SCHEMA WITHOUT PAID TOOLS PART OF PAGEBLOCKS AMAZING FRAMEWORK STARTED BY GREG WILLITS. ALSO INTEGRATES WITH L-UNIT. THE TRINITY IS NOW NIKOLAJ DE FINE LICHT, BRIAN LOOMIS, AND KE CARLTON.
  41. 41. FUN THERE WAS A YOUNG MAN FROM SOQUEL WHO THOUGHT HE KNEW ABOUT SQL HE LEARNED FLAT FILES WERE BAD AND ABSTRACTED LIKE MAD AND NO ONE IS HIS EQUAL
  42. 42. RESOURCES MARTIN FOWLER HTTP://MARTINFOWLER.COM/ARTICLES/EVODB.HTML GREG WILLITS SEMI-RETIRED (FROM LASSO) TAGSWAP HTTP://WWW.TAGSWAP.NET/ARTICLES BRIAN LOOMIS AIM DJDARKBEAT NIKOLAJ (PAGEBLOCKS) KE (L-UNIT)

×