Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Database deployments - dotnetsheff

Database deployments - dotnetsheff
2 March 2021
https://www.meetup.com/dotnetsheff/events/273184959/

  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Database deployments - dotnetsheff

  1. 1. Database deployments Giulio Vian — 3 March 2021
  2. 2. In a Start-up far far away DBA Senior Dev Scrum Master Junior Dev
  3. 3. Free! too good to be true • 0 $/£/€ = gratis! • open source • any DB! • 1,400 stars • and works!
  4. 4. Months pass It’s Friday: Let’s deploy the latest version!
  5. 5. Unpleasant situation
  6. 6. Migration-based Source: https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
  7. 7. Baseline (aka v0.0.0)
  8. 8. Independent migration scripts Conflict?
  9. 9. let’s use dacpac
  10. 10. Truth revealed
  11. 11. State-based Source: https://www.red-gate.com/hub/product-learning/sql-source-control/moving-from-application-automation-to-true-devops-by-including-the-database
  12. 12. Baseline (aka v0.0.0)
  13. 13. Baseline (aka v0.0.1)
  14. 14. Diff script from schema-based tool uh oh
  15. 15. Help me
  16. 16. Migration based v1  v2 Hides conflicts Order matters State based v1  v2 Miss object renames Rollback drifts Schema evolution
  17. 17. Migration based v1  v2 State based v1  v2 What to use
  18. 18. Your path you must decide
  19. 19. Are the two mutually exclusive? No Dev can use a Schema diff tool like SSDT to draft migration scripts Migration script can be augmented stating the baseline version State-based tools have pre- and post-deploy phases for data migration We can add dependency check between migration scripts To warn about scripts interaction and dependency
  20. 20. Hardware spec: 1 KB RAM (16KB after upgrade) 4 KB ROM (8KB after upgrade) First computer Past Companies Communities Giulio Vian Senior DevOps Engineer @giulio_vian giuliovdev@hotmail.com
  21. 21. References Tools SQL Server Data Tools (SSDT) RedGate SQL Compare devart Flyway dbup dbdeploy.net Articles https://en.wikipedia.org/wiki/Sc hema_migration https://martinfowler.com/article s/evodb.html https://michaeljswart.com/2018 /01/100-online-deployments http://blog.dixo.net/2015/02/bl ue-turquoise-green-deployment Books Refactoring Databases: Evolutionary Database Design http://www.agiledata.org/
  22. 22. Thank you! Giulio Vian @giulio_vian giuliovdev@hotmail.com
  23. 23. Deployment Process
  24. 24. Database Refactoring Cycle Initial state Final state Implement the refactoring Test on non-production Refactoring completed deploy new schema, migrate data deploy new application version
  25. 25. Database Refactoring Cycle Initial state Final state Implement the refactoring Test on non-production Refactoring completed deploy new schema, migrate data deploy new application version
  26. 26. Database Refactoring Cycle Initial state Final state Transitional state Implement the refactoring Test on non-production Refactoring completed All systems use the new schema Coexistence of old and new schema Expand: deploy new schema, migrate data, add scaffolding code Contract: Drop old schema objects and scaffolding code
  27. 27. Recapping
  28. 28. applications DATa
  29. 29. La morale Tools are limited Know your stuff is the only way Discipline
  30. 30. Migration troubles with DbUp also FlyWay, Liquibase, etc.
  31. 31. State troubles with dacpac

×