Development Lifecycle Basics for DBAs By Eitan Blumin
Development Lifecycle Basics for DBAs By Eitan Blumin Image by Dirk Wouters / Pixabay
Copyright © 2019 Madeira Ltd All Rights Reserved Full rights, including copyrights, belong exclusively to Madeira Ltd No use of the materials, in any form, is allowed, unless receiving a prior written permission from Madeira Ltd Image by Dirk Wouters / Pixabay
About Me… Name: Email: Twitter: Linked. In: Blog: Eitan Blumin eitan@madeiradata. com @Eitan. Blumin www. linkedin. com/in/eitanblumin www. eitanblumin. com Image by Pete Linforth / Pixabay
Part 1 - Agenda § Why? (Database Dev. Ops) § What… § § … is Source Control? … are Unit Tests? … are CI / CD Pipelines? … is SSDT? Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? Once upon a time… The classic DBA’s tool set: • Custom-built. • Gets you from A to B. • Closely familiar with deepest inner workings. • Old and outdated. • Takes too much time to use and maintain. • Heavily prone to user error. Photo by Joshua Willson Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? Once upon a time… The classic DBA’s tool set: • Main development tool: • • Source Control: • • Dropbox or something (if at all) Unit Testing: • • DBA’s workstation / File server / Live Version History: • • SSMS Huh? CI / CD: • LOL Photo by Joshua Willson Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? The Software Developer’s tool set: • • • Early error detection. Automated testing. Automated integration. Automated deployment. Collaborative development. Cool “toys” (extensions, plugins, templates, etc. ) Image by Ubisoft’s Star Trek: Bridge Crew, Venture. Beat Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? The Software Developer’s tool set: • Main development tool: • Visual Studio / VS Code ü Source Control ü Version History ü Unit Testing ü CI / CD Image by Ubisoft’s Star Trek: Bridge Crew, Venture. Beat Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? This thing here is actually important. (who knew, right? ) Image by Pete Linforth / Pixabay
Database Dev. Ops – Why? Individual Team But…. Database Dev. Ops is HARD! Image by Pete Linforth / Pixabay
CI/CD: Our End Goal Developer Source Control Automated Tests Automated Deployment Image by Pete Linforth / Pixabay
Git Source Control Basic Terms & Methodologies Image by Pete Linforth / Pixabay
Git Basics IDE commit / pull / undo Image by 4 tecture Image by Pete Linforth / Pixabay
Git Basics Merge Split Pull Request Image by Pete Linforth / Pixabay
Git Flow Basics push / pull IDE commit / pull / undo Local Repository Image by Nu. Relm Image by Pete Linforth / Pixabay
Git Flow Basics • • • master must always reflect what is on the production server. develop reflects current development in progress at the team / organization level. feature reflects current development at the individual developer / feature level. release reflects a pending release with (possibly) last-minute changes. hotfix reflects “emergency” fixes that must be pushed to production ASAP. Image by Nu. Relm Image by Pete Linforth / Pixabay
Development Lifecycle Basics clone repository split branch merge branch approval pull (existing) “sync” create pull request commit changes push Image by Pete Linforth / Pixabay
Popular Git Source Control Tools • • • Git. Hub Git. Lab Bit. Bucket (Atlassian) Azure Repos (Azure Dev. Ops) Also non-Git source control tools (TFS, SVN, etc. ) Ask the software developers or PM in your organization (Visual Studio natively integrates with all of them) Image by Pete Linforth / Pixabay
CI/CD & Dev. Ops Basic Terms Image by Pete Linforth / Pixabay
What are Unit Tests? • Most granular and basic level of tests • Defined per single function/method • “State-machine” type tests • Input->expected output • Integral part of the CI/CD pipeline • Automated • Meant to immediately detect breaking changes • Difficult and time-consuming to design and implement • Visual Studio project type: MSTest Image by Gerd Altmann / Pixabay
What is an Artifact? Project Deploy Artifact Build Target Production more stuff happen here Image by Gerd Altmann / Pixabay
What is an Artifact? Project Build Deploy Artifact Target Production . dll , . exe , . msi , . ispac , . dacpac , . . . Image by Gerd Altmann / Pixabay
CI/CD Pipelines Basics & Methodologies Image by Pete Linforth / Pixabay
Example CI/CD Pipeline trigger build report approval Ø Test / QA Server Ø Staging Server Ø Production Server report tests copy deploy Image by Gerd Altmann / Pixabay
Example CI/CD Pipeline trigger build report approval CI (Build / Integration) report CD (Deployment) tests copy CD (Delivery) deploy Image by Gerd Altmann / Pixabay
Triggering / Approving CI/CD via Git Develop branch -> Build Server, CI Pipeline Release and Hotfix branches -> Staging Server, CD Pipeline Master branch -> Production Server, CD Pipeline Image by Nu. Relm Image by Gerd Altmann / Pixabay
Popular CI/CD Pipeline Tools • • • Azure Pipelines (VSTS Pipelines) Bamboo (Atlassian) Git. Lab AWS Code. Pipelines / Code. Deploy Jenkins Travis CI Team. City Octopus Deploy And many more Image by Gerd Altmann / Pixabay
Azure Pipelines Source: https: //www. mssqltips. com/sqlservertip/5985/continuous-database-deployments-with-azure-devops/ Image by Gerd Altmann / Pixabay
Octopus Deploy https: //octopus. com/blog/octopus-deploy-3. 7 -effortless-step-templates Image by Gerd Altmann / Pixabay
Jenkins https: //www. guru 99. com/jenkin-continuous-integration. html Image by Gerd Altmann / Pixabay
… and many more Ask the Dev. Ops guy / team in your organization Image by Gerd Altmann / Pixabay
What is SQL Server Data Tools? • • • Available for Free from Microsoft Set of tools and project types for Microsoft Visual Studio Combination of Extensions and Add-Ons SQL Database Project BI Project Types (SSRS, SSIS, SSAS) Utilities: • Schema and Data Compare • Refactoring • Unit Testing https: //docs. microsoft. com/sql/ssdt/ Image by Pete Linforth / Pixabay
What is SQL Server Data Tools? • Build command: • MSBuild. exe • Project artifact: • . dacpac • Deployment command: • Sql. Package. exe • Unit test project type: • MSTest • Unit test execution: • VSTest. Console. exe https: //docs. microsoft. com/sql/ssdt/ Image by Pete Linforth / Pixabay
What is SQL Server Data Tools? • To be continued in Part 2: SSDT Methodology & Features for DB Dev. Ops https: //docs. microsoft. com/sql/ssdt/ Image by Pete Linforth / Pixabay
Questions? Image by David Castillo Dominici / Free. Digital. Photos. net Image by Pete Linforth / Pixabay Image by Dirk Wouters from Pixabay
Keep in touch… Name: Email: Twitter: Linked. In: Blog: Also in: Eitan Blumin eitan@madeiradata. com @Eitan. Blumin www. linkedin. com/in/eitanblumin www. eitanblumin. com www. madeiradata. com Image by Pete Linforth / Pixabay
- Slides: 36