SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Ernest Hwang
Principal Software Engineer, Practice Fusion
http://practicefusion.com/careers/
Who am I?
• Ernest Hwang, Principal Software Engineer
at Practice Fusion in San Francisco (We’re Hiring!)
• C#, .NET Developer since 2001
• SQL Server Developer since 1999 (SQL Server 6.x)
• Using Red Gate for Continuous Integration since June
2011
About Practice Fusion
Why am I here?
What is this?
A “How To” guide for automating your day-to-day
maintenance tasks by…
• *Easily* Versioning your database using Red Gate
SQL Source Control
• Using Continuous Integration (via Jenkins) to validate
Database builds
• Using Jenkins to automate database deployments
• Using CI / tSQLt / SQL Test to run unit tests
Prerequisites
• Experience with source control management systems
(svn, TFS, git, Hg)
• Familiarity with Continuous Integration Products
(Jenkins, Team City, Cruise Control)
• Awareness of build scripting languages (ant,
MSBuild)
What software is used?
•
•
•
•
•
–
–
–
–
•

SQL Server 2008 / 2012
Red Gate SQL Source Control
Red Gate SQL Compare
Red Gate SQL Data Compare
Jenkins Continuous Integration Server
http://jenkins-ci.org/
Promoted Build Plugin
Copy Artifacts Plugin
Version Plugin
Git Plugin
MSBuild
What is SQL Source Control
• Source Control plug in for SQL Server
Management Studio
• Creates a “snapshot” of the database schema
defined by CREATE scripts
• Snapshot is consumable by SQL Compare and
may be used to compare against the schema of
an actual database
What is SQL Source Control?
SQL Source Control is to SSMS
as
TortoiseSVN is to Windows Explorer
Demo Environment
GitHub

Developer Workstation

Local Copy of
RGDemo database

Build and Database Server
(Windows Azure VM)

Dev, QA, & Prod
Databases
Commiting Changes to Source Control
Demo

Local Database
Changes

Commit Changes
via SQL Source
Control

Changes committed to
SCM repository
How does Continuous Integration fit
in?
• The CI server polls the repository for changes
• When changes are checked in, the CI job kicks off
– Verifies that the database can be built
• Builds a brand new database from scratch using SQL
Compare and SQL Data Compare
– Runs unit tests
• Build should fail if unit tests do not succeed
– Archives the artifacts (for deployments)
• Artifacts can include build/test reports
– Emails engineers if there are problems
I’M THE ONE WHO DROPS TABLES!
(demo)
Deploying Changes to Different
Environments
• The Promoted Builds plug in can be used to
deploy changes to
Integration/QA/Staging/Production environments
• SQL Compare and SQL Data Compare are
used to deploy changes between the sourced
controlled database and your development
environments
• Deploying to Production and/or Staging can be
configured to just create the scripts as opposed
to forcing the synchronization
Deploying to Dev / QA
Demo

SQL Source Control
Repository

SQL Compare

Development Environment
Database
Creating a Database “Version”
• Make sure the Jenkins Versioning plugin is
installed
• Create a User Defined Function called
dbo.DATABASE_VERSION()
• Create a build step that updates the UDF with
the version number
• The updated UDF will be archived and used with
deployments
Versioning your Database
Demo

Commit Changes
via SQL Source
Control

CI Server Detects
Changes
Kicks off Build
Process

Build Task updates
dbo.DATABASE_VERSION()
Function

Updated UDF
Archived
Unit Testing with tSQLt and SQL Test
• tSQLt is an open source set of stored procedures and
functions to facilitate Unit Testing in SQL databases
• SQL Test is a wrapper around this framework that
integrates with SSMS
• Your build server can enforce that your unit tests pass
and generate reports
Unit Testing with tSQLt / SQL Test
Demo

Commit Changes
via SQL Source
Control

CI Server Detects
Changes
Kicks off Build
Process

Build Task executes
Unit Test procedures

Tests can pass or
fail the build
Migrations
Springer’s Final Thought
• Saves developers time (yay!)
– No more maintaining update scripts
– Don’t need to deploy scripts when QA needs changes
• Identifies holes in your deployment process
– Are developers or DBAs making changes directly to
production?
– Are indexes/constraints missing from your
Dev/QA/Prod environments?
• Creates a definitive database build that can be easily
deployed and redeployed
Considerations
• Environments must be pristine
• Process must be changed and understood
• Production change scripts should be scrutinized
(especially for the first few releases)
• Migration Scripts can be used to massage data
• DB Replication requires more work for
promotions
Appendix 1: Other CI Servers
•
•
•
•

Jenkins (open source)
Team City (JetBrains)
Bamboo (Atlassian)
CruiseControl / CruiseControl.NET (open source)
Appendix 2: Other Source Control
Systems
•
•
•
•
•
•

Subversion (SVN)
Git
Team Foundation Server
Mercurial (Hg)
AccuRev
Surround SCM
Links / Contact Info
•
•
•

ehwang@practicefusion.com
@ernestedcode
https://github.com/CF9/Databases.RGDemo

•

Practice Fusion is Hiring (email me)
http://practicefusion.com/careers/
facebook.com/practicefusion
@practicefusion

•
•

Weitere ähnliche Inhalte

Was ist angesagt?

Everything as Code with Azure DevOps
Everything as Code with Azure DevOpsEverything as Code with Azure DevOps
Everything as Code with Azure DevOpsVenura Athukorala
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha
 
Working with FME in an Agile Software Development Lifecycle
Working with FME in an Agile Software Development LifecycleWorking with FME in an Agile Software Development Lifecycle
Working with FME in an Agile Software Development LifecycleSafe Software
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAPVictor Morales
 
Continuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and JenkinsContinuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and JenkinsMahmoud Ali
 
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015Pavel Chunyayev
 
Working Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductiveWorking Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductivePerforce
 
Continuous Delivery with Chef and GoCD
Continuous Delivery with Chef and GoCDContinuous Delivery with Chef and GoCD
Continuous Delivery with Chef and GoCDAroj George
 
Introduction to Enterprise-Release Engineering on the Salesforce Platform
Introduction to Enterprise-Release Engineering on the Salesforce PlatformIntroduction to Enterprise-Release Engineering on the Salesforce Platform
Introduction to Enterprise-Release Engineering on the Salesforce PlatformSalesforce Developers
 
Build Your Custom Performance Testing Framework
Build Your Custom Performance Testing FrameworkBuild Your Custom Performance Testing Framework
Build Your Custom Performance Testing FrameworkTechWell
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanthRavikanth Chaganti
 
CI_CD_Demo.pptx
CI_CD_Demo.pptxCI_CD_Demo.pptx
CI_CD_Demo.pptxTheGame26
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introductionGourav Varma
 
Acquia presented at MassTLC event on automated testing
Acquia presented at MassTLC event on automated testingAcquia presented at MassTLC event on automated testing
Acquia presented at MassTLC event on automated testingMassTLC
 
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDavide Benvegnù
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsPerforce
 
A Report on Web Application Framework Benchmarks and Perl's Performance
A Report on Web Application Framework Benchmarks and Perl's PerformanceA Report on Web Application Framework Benchmarks and Perl's Performance
A Report on Web Application Framework Benchmarks and Perl's PerformanceCrimson Thompson
 

Was ist angesagt? (20)

Everything as Code with Azure DevOps
Everything as Code with Azure DevOpsEverything as Code with Azure DevOps
Everything as Code with Azure DevOps
 
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
Sencha Roadshow 2017: Sencha Upgrades - The Good. The Bad. The Ugly - Eva Luc...
 
Working with FME in an Agile Software Development Lifecycle
Working with FME in an Agile Software Development LifecycleWorking with FME in an Agile Software Development Lifecycle
Working with FME in an Agile Software Development Lifecycle
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAP
 
Continuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and JenkinsContinuous Integration and Delivery using TeamCity and Jenkins
Continuous Integration and Delivery using TeamCity and Jenkins
 
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015
You don’t need DTAP + Backbase implementation - Amsterdam 17-12-2015
 
Working Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductiveWorking Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams Productive
 
Continuous Delivery with Chef and GoCD
Continuous Delivery with Chef and GoCDContinuous Delivery with Chef and GoCD
Continuous Delivery with Chef and GoCD
 
Test eng-meetup-taki take
Test eng-meetup-taki takeTest eng-meetup-taki take
Test eng-meetup-taki take
 
Introduction to Enterprise-Release Engineering on the Salesforce Platform
Introduction to Enterprise-Release Engineering on the Salesforce PlatformIntroduction to Enterprise-Release Engineering on the Salesforce Platform
Introduction to Enterprise-Release Engineering on the Salesforce Platform
 
Build Your Custom Performance Testing Framework
Build Your Custom Performance Testing FrameworkBuild Your Custom Performance Testing Framework
Build Your Custom Performance Testing Framework
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
 
CI_CD_Demo.pptx
CI_CD_Demo.pptxCI_CD_Demo.pptx
CI_CD_Demo.pptx
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Acquia presented at MassTLC event on automated testing
Acquia presented at MassTLC event on automated testingAcquia presented at MassTLC event on automated testing
Acquia presented at MassTLC event on automated testing
 
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring InsightSplunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
Splunk conf2014 - Using Selenium and Splunk for Transaction Monitoring Insight
 
Dev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps worldDev/Test scenarios in DevOps world
Dev/Test scenarios in DevOps world
 
Five Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce StreamsFive Real-World Strategies for Perforce Streams
Five Real-World Strategies for Perforce Streams
 
A Report on Web Application Framework Benchmarks and Perl's Performance
A Report on Web Application Framework Benchmarks and Perl's PerformanceA Report on Web Application Framework Benchmarks and Perl's Performance
A Report on Web Application Framework Benchmarks and Perl's Performance
 

Ähnlich wie Database Build and Release - SQL In The City - Ernest Hwang

KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBATobias Koprowski
 
Database CI Demo Using Sql Server
Database CI  Demo Using Sql ServerDatabase CI  Demo Using Sql Server
Database CI Demo Using Sql ServerUmesh Kumar
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkinsecubemarketing
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life DevOps.com
 
Ci for force dot com
Ci for force dot comCi for force dot com
Ci for force dot comDon McIntosh
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build testLen Bass
 
Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringarSqueed
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applicationsSunil Dalal
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneciberkleid
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the DatabaseMichaela Murray
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?Vincent Biret
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practicesCode Mastery
 
Database Change Management
Database Change Management Database Change Management
Database Change Management headspringlabs
 
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...Codecamp Romania
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps JumpstartOri Donner
 
1.microsoft visual studio 2010 test manager
1.microsoft visual studio 2010  test manager1.microsoft visual studio 2010  test manager
1.microsoft visual studio 2010 test managerAshwin Jujgar
 
Sps monaco vincent biret spfx devops
Sps monaco vincent biret spfx devopsSps monaco vincent biret spfx devops
Sps monaco vincent biret spfx devopsVincent Biret
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as CodeRobert Greiner
 

Ähnlich wie Database Build and Release - SQL In The City - Ernest Hwang (20)

KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
 
Database CI Demo Using Sql Server
Database CI  Demo Using Sql ServerDatabase CI  Demo Using Sql Server
Database CI Demo Using Sql Server
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
Dev ops using Jenkins
Dev ops using JenkinsDev ops using Jenkins
Dev ops using Jenkins
 
Continuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with JenkinsContinuous Integration for OpenVMS with Jenkins
Continuous Integration for OpenVMS with Jenkins
 
Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life Achieving Full Stack DevOps at Colonial Life
Achieving Full Stack DevOps at Colonial Life
 
Ci for force dot com
Ci for force dot comCi for force dot com
Ci for force dot com
 
Architecting for the cloud storage build test
Architecting for the cloud storage build testArchitecting for the cloud storage build test
Architecting for the cloud storage build test
 
Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringar
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
Continuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOneContinuous Deployment of your Application @SpringOne
Continuous Deployment of your Application @SpringOne
 
Bringing DevOps to the Database
Bringing DevOps to the DatabaseBringing DevOps to the Database
Bringing DevOps to the Database
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
 
Build automation best practices
Build automation best practicesBuild automation best practices
Build automation best practices
 
Database Change Management
Database Change Management Database Change Management
Database Change Management
 
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...
Iasi code camp 20 april 2013 marian chicu - database unit tests in the sql se...
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
1.microsoft visual studio 2010 test manager
1.microsoft visual studio 2010  test manager1.microsoft visual studio 2010  test manager
1.microsoft visual studio 2010 test manager
 
Sps monaco vincent biret spfx devops
Sps monaco vincent biret spfx devopsSps monaco vincent biret spfx devops
Sps monaco vincent biret spfx devops
 
Infrastructure as Code
Infrastructure as CodeInfrastructure as Code
Infrastructure as Code
 

Mehr von Red Gate Software

The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...Red Gate Software
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayRed Gate Software
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersRed Gate Software
 
Mizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyMizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyRed Gate Software
 
7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoringRed Gate Software
 
Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Red Gate Software
 
Key findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportKey findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportRed Gate Software
 
Extend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesExtend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesRed Gate Software
 
What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019Red Gate Software
 
Quality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityQuality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityRed Gate Software
 
How SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterHow SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterRed Gate Software
 
DevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesDevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesRed Gate Software
 
Successfully migrating existing databases to Azure
Successfully migrating existing databases to AzureSuccessfully migrating existing databases to Azure
Successfully migrating existing databases to AzureRed Gate Software
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolThe Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolRed Gate Software
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Red Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseUsing Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseRed Gate Software
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseUsing Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseRed Gate Software
 
How to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeHow to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeRed Gate Software
 

Mehr von Red Gate Software (20)

The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...The future of DevOps: fully left-shifted deployments with version control and...
The future of DevOps: fully left-shifted deployments with version control and...
 
Embracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with FlywayEmbracing DevOps through database migrations with Flyway
Embracing DevOps through database migrations with Flyway
 
Database DevOps for Managed Service Providers
Database DevOps for Managed Service ProvidersDatabase DevOps for Managed Service Providers
Database DevOps for Managed Service Providers
 
Mizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journeyMizuho Financial: Launching our Database DevOps journey
Mizuho Financial: Launching our Database DevOps journey
 
7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring7 steps to effective SQL Server monitoring
7 steps to effective SQL Server monitoring
 
Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control Level up your deployments for SQL Source Control
Level up your deployments for SQL Source Control
 
Key findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops reportKey findings from the 2020 state of database dev ops report
Key findings from the 2020 state of database dev ops report
 
Extend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server DatabasesExtend DevOps to Your SQL Server Databases
Extend DevOps to Your SQL Server Databases
 
2019 year in review slides
2019 year in review slides2019 year in review slides
2019 year in review slides
 
What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019What we learned at PASS Summit in 2019
What we learned at PASS Summit in 2019
 
Quality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin UniversityQuality in Software Development: Anglia Ruskin University
Quality in Software Development: Anglia Ruskin University
 
How SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value fasterHow SQL Change Automation helps you deliver value faster
How SQL Change Automation helps you deliver value faster
 
DevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve JonesDevOps essentials from Abel Wang and Steve Jones
DevOps essentials from Abel Wang and Steve Jones
 
Successfully migrating existing databases to Azure
Successfully migrating existing databases to AzureSuccessfully migrating existing databases to Azure
Successfully migrating existing databases to Azure
 
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring ToolThe Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
The Ultimate Guide to Choosing and Implementing the Right Monitoring Tool
 
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
Everything You Need to Know About the 2019 DORA Accelerate State of DevOps Re...
 
Using Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseUsing Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your database
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseUsing Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your Database
 
How to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture ChangeHow to Pitch a Software Development Initiative and Ignite Culture Change
How to Pitch a Software Development Initiative and Ignite Culture Change
 
Taming the Wild West
Taming the Wild West Taming the Wild West
Taming the Wild West
 

Kürzlich hochgeladen

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Kürzlich hochgeladen (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Database Build and Release - SQL In The City - Ernest Hwang

  • 1. Ernest Hwang Principal Software Engineer, Practice Fusion http://practicefusion.com/careers/
  • 2. Who am I? • Ernest Hwang, Principal Software Engineer at Practice Fusion in San Francisco (We’re Hiring!) • C#, .NET Developer since 2001 • SQL Server Developer since 1999 (SQL Server 6.x) • Using Red Gate for Continuous Integration since June 2011
  • 4. Why am I here?
  • 5. What is this? A “How To” guide for automating your day-to-day maintenance tasks by… • *Easily* Versioning your database using Red Gate SQL Source Control • Using Continuous Integration (via Jenkins) to validate Database builds • Using Jenkins to automate database deployments • Using CI / tSQLt / SQL Test to run unit tests
  • 6. Prerequisites • Experience with source control management systems (svn, TFS, git, Hg) • Familiarity with Continuous Integration Products (Jenkins, Team City, Cruise Control) • Awareness of build scripting languages (ant, MSBuild)
  • 7. What software is used? • • • • • – – – – • SQL Server 2008 / 2012 Red Gate SQL Source Control Red Gate SQL Compare Red Gate SQL Data Compare Jenkins Continuous Integration Server http://jenkins-ci.org/ Promoted Build Plugin Copy Artifacts Plugin Version Plugin Git Plugin MSBuild
  • 8. What is SQL Source Control • Source Control plug in for SQL Server Management Studio • Creates a “snapshot” of the database schema defined by CREATE scripts • Snapshot is consumable by SQL Compare and may be used to compare against the schema of an actual database
  • 9. What is SQL Source Control? SQL Source Control is to SSMS as TortoiseSVN is to Windows Explorer
  • 10. Demo Environment GitHub Developer Workstation Local Copy of RGDemo database Build and Database Server (Windows Azure VM) Dev, QA, & Prod Databases
  • 11. Commiting Changes to Source Control Demo Local Database Changes Commit Changes via SQL Source Control Changes committed to SCM repository
  • 12. How does Continuous Integration fit in? • The CI server polls the repository for changes • When changes are checked in, the CI job kicks off – Verifies that the database can be built • Builds a brand new database from scratch using SQL Compare and SQL Data Compare – Runs unit tests • Build should fail if unit tests do not succeed – Archives the artifacts (for deployments) • Artifacts can include build/test reports – Emails engineers if there are problems
  • 13. I’M THE ONE WHO DROPS TABLES! (demo)
  • 14. Deploying Changes to Different Environments • The Promoted Builds plug in can be used to deploy changes to Integration/QA/Staging/Production environments • SQL Compare and SQL Data Compare are used to deploy changes between the sourced controlled database and your development environments • Deploying to Production and/or Staging can be configured to just create the scripts as opposed to forcing the synchronization
  • 15. Deploying to Dev / QA Demo SQL Source Control Repository SQL Compare Development Environment Database
  • 16. Creating a Database “Version” • Make sure the Jenkins Versioning plugin is installed • Create a User Defined Function called dbo.DATABASE_VERSION() • Create a build step that updates the UDF with the version number • The updated UDF will be archived and used with deployments
  • 17. Versioning your Database Demo Commit Changes via SQL Source Control CI Server Detects Changes Kicks off Build Process Build Task updates dbo.DATABASE_VERSION() Function Updated UDF Archived
  • 18. Unit Testing with tSQLt and SQL Test • tSQLt is an open source set of stored procedures and functions to facilitate Unit Testing in SQL databases • SQL Test is a wrapper around this framework that integrates with SSMS • Your build server can enforce that your unit tests pass and generate reports
  • 19. Unit Testing with tSQLt / SQL Test Demo Commit Changes via SQL Source Control CI Server Detects Changes Kicks off Build Process Build Task executes Unit Test procedures Tests can pass or fail the build
  • 21. Springer’s Final Thought • Saves developers time (yay!) – No more maintaining update scripts – Don’t need to deploy scripts when QA needs changes • Identifies holes in your deployment process – Are developers or DBAs making changes directly to production? – Are indexes/constraints missing from your Dev/QA/Prod environments? • Creates a definitive database build that can be easily deployed and redeployed
  • 22. Considerations • Environments must be pristine • Process must be changed and understood • Production change scripts should be scrutinized (especially for the first few releases) • Migration Scripts can be used to massage data • DB Replication requires more work for promotions
  • 23. Appendix 1: Other CI Servers • • • • Jenkins (open source) Team City (JetBrains) Bamboo (Atlassian) CruiseControl / CruiseControl.NET (open source)
  • 24. Appendix 2: Other Source Control Systems • • • • • • Subversion (SVN) Git Team Foundation Server Mercurial (Hg) AccuRev Surround SCM
  • 25. Links / Contact Info • • • ehwang@practicefusion.com @ernestedcode https://github.com/CF9/Databases.RGDemo • Practice Fusion is Hiring (email me) http://practicefusion.com/careers/ facebook.com/practicefusion @practicefusion • •