grant fritchey justin caldicott - best practices for database deployments
DESCRIPTION
Best practices for database deployments - by Grant Fritchey and Justin Caldicott.TRANSCRIPT
![Page 1: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/1.jpg)
Best Practices for Database Deployments
Grant Fritchey, Justin Caldicott
#sqlinthecity
![Page 2: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/2.jpg)
Goals
• Understand how to create your own deployment mechanisms
• Learn about the tools available for automation of the deployment process
• Acquire the knowledge of how to test your deployments
#sqlinthecity
![Page 3: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/3.jpg)
The Database “Problem”
• Information persistence layer• Businesses like their data• Keeping that data in place can be work–Which is the start of the “problem”
• Object Relational Impedance Mismatch –Which is the rest of the “problem”
3
![Page 4: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/4.jpg)
The Database “Solution”
• Treat it as much like code as possible• Do the following–Work directly with the development team– Define a repeatable process– Put the database into source control– Put tests in place to validate the database– Automate as much of the process as
possible• Follow the local development paradigm as
much as possible
4
![Page 5: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/5.jpg)
Process: Team Glue
• You must define a process– It’s your process, you define it
• Management buy-in• Write the process down– And publish it
• Review process regularly• Follow the process– Exceptions have to be exceptional
• The process applies to everyone– No, DBAs, you’re not that special
5
![Page 6: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/6.jpg)
Development Process
Development
QA/Testing
Production
![Page 7: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/7.jpg)
Building a Deployment Process
Development
QA/Testing
Production
![Page 8: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/8.jpg)
Building a Deployment Process• Production deployment script• Test script on copy of production• Generate script for production from label• Label code in source control• Add changes to source control• Make changes to code• Get code from source control
![Page 9: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/9.jpg)
Source Control
• Two known states– Production– Source Control
• Ensures coupling between application and database
• History of changes• Auditing
![Page 11: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/11.jpg)
Testing Deployments
• ABD– Always Be Deploying
• Unit Testing• Continuous Integration• Copies of production
![Page 13: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/13.jpg)
Deploying to Multiple Environments
• Multiple moves between multiple environments
• Every deployment is practice
![Page 14: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/14.jpg)
Deploying to Multiple Environments
• Multiple moves between multiple environments
• Every deployment is practice
![Page 15: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/15.jpg)
Deploying to Multiple Environments
• Multiple moves between multiple environments
• Every deployment is practice
![Page 16: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/16.jpg)
Deploying to Multiple Environments
• Multiple moves between multiple environments
• Every deployment is practice
![Page 18: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/18.jpg)
Integrating Database with Application
• Coupled through source control• Labeled together• Deployed together• Database is deployed first
![Page 20: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/20.jpg)
Deployment Automation
• Remove humans from the equation• Speed the process• Make the process repeatable• Take advantage of the tools you know
![Page 22: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/22.jpg)
Summary
• Define a process• Work backwards from production• All database code in source control• Integrate tightly with development team• Test and validate all code• Automate as much as possible
![Page 23: Grant Fritchey Justin Caldicott - Best practices for database deployments](https://reader035.vdocuments.site/reader035/viewer/2022081603/558525e4d8b42a4c128b4ee6/html5/thumbnails/23.jpg)
Goals
• Understand how to create your own deployment mechanisms
• Learn about the tools available for automation of the deployment process
• Acquire the knowledge of how to test your deployments
#sqlinthecity