SlideShare a Scribd company logo
DEVOPS+DATA:
WORKING WITH SOURCE CONTROL
Ed Leighton-Dick
ABOUT ME
Email: ed@leightondick.com
Blog: edleightondick.com
Twitter: @eleightondick
GOALS
• Understand DevOps
• Understand source control
• How to apply source control to data
DEVOPS
WHAT IS DEVOPS?
• “DevOps is the practice of operations and development
engineers participating together in the entire service
lifecycle, from design through the development process to
production support.”
• Corollary: “DevOps is also characterized by operations staff
making use [of] many of the same techniques as developers
for their systems work.”
Source: https://theagileadmin.com/what-is-devops/
WHAT IS DEVOPS?
• Incorporates
• Structured processes favored by operations
• Flexibility favored by developers
• Built around consistent processes and practices
• Evolved from need to better support Agile
• Often includes Continuous Integration/Continuous Delivery
WHAT’S THE BIG DEAL?
• Improved communication and collaboration
• Improved productivity and efficiency
• More regular, more consistent software updates
• Improved software quality
• Reduced time to recover from failed releases
• Lower risk
STAGES
• Code
• Build
• Verify
• Package
• Release
• Configure
• Monitor
Image Credit: By Kharnagy - Own work, CC BY-SA 4.0,
https://commons.wikimedia.org/w/index.php?curid=51215412
DEVOPS+DATA
• Databases are harder to automate
• Shared resource
• Code mixed in with data
• Mix of static and dynamic data
• Objects must be modified, not simply replaced
• Databases are integral components of most applications
SOURCE CONTROL
SOURCE CONTROL
• Practices and supporting systems that support the
management of changes to application code
• Stores history of changes
• Facilitates merging of conflicting changes
• AKA: version control, source management, revision control
TYPES OF SOURCE CONTROL
• Centralized
• PVCS
• Microsoft Visual Source Safe
• Microsoft Team Foundation Server
• Subversion (SVN)
• Distributed
• Git
• Mercurial
COMPARISON
Centralized
• One snapshot + deltas
• Working copy =
Most recent version
• Work solely on
central repository
• One source of truth
Distributed
• Git: Snapshots
• Working copy =
Full copy of repository
• Work primarily with
local repository
• ??
TRADITIONAL
• Repository
• Working folder
• Check-out and check-in
• Commits
• Branching and merging
DISTRIBUTED
• Repository
• Local repository
• Cloning
• Pull
• Push
• Branching and merging
VCS+DATA
VCS+DATA
• Databases should be included in source control
• Database code = Application code
• Static data = Application code
• Most applications cannot run without their database(s)
VCS+DATA
• Database professionals have been slow to adopt source
control
• Many DBAs have no development experience
• Lack of communication about why
• Lack of communication/inclusion with development teams
• Migration vs deployment
• Lack of pre-built tools to facilitate complex database changes
VCS+DATA: WHY NOW?
• The situation has changed
• Modern tools now exist to facilitate technical side
• DevOps changes the conversation
VCS+DATA MODELS
• Schema-only
• Changes-only
• Hybrid
THE SCHEMA-ONLY MODEL
• Code for all database objects stored
• Mirrors model used by most application code
• Can produce a clean copy of a specific version of a database
• Cannot migrate to a new version of a database without help
• Used by…
• Roll-your-own
• Most third-party tools* - Microsoft, Redgate, ApexSQL, DBMaestro
THE CHANGES-ONLY MODEL
• Scripts to upgrade between versions are stored
• Scripts to create a clean copy may not be stored
• Used by…
• Roll-your-own (very common)
THE HYBRID MODEL
• Stores scripts used to create objects
• Stores scripts used to migrate between versions
• Used by…
• Redgate SQL Source Control (with migration scripts)
• Redgate ReadyRoll
• Others?
FIRST THINGS FIRST…
• All changes must be saved to source control for source
control to be useful
• Database cannot enforce this – Unaware of source control
• Source control cannot enforce this – Unaware of changes
• External tools may be able to monitor but cannot yet enforce –
No control over database or source control
• Cannot move further in DevOps without good source control
FIRST THINGS FIRST…
• Decide on your process before implementing tools
• What objects are saved to source control?
• What changes are saved?
• Who saves changes?
• How often?
• Who/what will enforce process? How?
SHARED VS DEDICATED
• Two models for working with development databases
• Shared
• Dedicated
SHARED DEVELOPMENT MODEL
• Data kept in central location
• More efficient from technical perspective
• Less disk space
• Less management overhead
• Developers must be concerned with conflicts with each
others’ work
• Integration done at time of development
• Refreshing can be difficult
DEDICATED DEVELOPMENT MODEL
• Each developer has their own copy of the database
• Developer is able to work more efficiently
• No conflicts with other developers’ work
• Copy of database is stored locally in many cases
• Data is more easily refreshed
• Integration occurs between development and testing
• Concerns
• Transporting and storage of large databases
• Security of data
• Management overhead
WHICH IS BETTER?
• No right answer
• Often dictated by circumstances
• My preference: As close to dedicated as possible
• Redgate SQL Clone can help facilitate refreshing,
management
• Solves some problems
• Still requires connection to central image
RELEASING CHANGES
• The problem:
How do we generate the deltas that matter to us?
• Source control deltas = Differences between stored versions
(Not useful for migrations)
• Databases require change scripts of some sort
TOOLS
• Microsoft Visual Studio Database Projects
• Feature of Visual Studio
• Developers works with creation scripts, rather than directly with
database
• “Declarative database development” model
• Schema Comparison used to generate change scripts
TOOLS
• Redgate approaches
• SQL Source Control
• More “behind the scenes” than database projects
• Integrated into SQL Server Management Studio
• Uses SQL Compare to generate change scripts at time of release
• Manually-created migration scripts override generated change scripts
• ReadyRoll
• Integrated into Visual Studio
• Uses SQL Compare to generate migration scripts at time of commit
• Edit generated migration scripts to override
DEMO
BEST PRACTICES
• Make database source control part of your team’s standard
development process
• Don’t make it only the DBA’s responsibility
• One object/change per file
• Check-in changes on a regular basis
• Find a solution that integrates with what your developers
already use
• Don’t allow code changes outside of the process
• Store the database build number in the database
WRAP-UP
GOALS
• Understand DevOps
• Understand source control
• How to apply source control to data
QUESTIONS?
Email: ed@leightondick.com
Blog: edleightondick.com
Twitter: @eleightondick
THANK YOU FOR ATTENDING!
~ Please remember to fill out your comment cards ~

More Related Content

What's hot (20)

PDF
VSTS Migration Briefing
Angela Dugan
 
PDF
Overview and Demonstration of Dimensions CM 14.2 (FUG presentation track 2)
Serena Software
 
PDF
Agile Secure Cloud Application Development Management
Adam Getchell
 
PPTX
The Future of Change Management and DevOps for Dummies
DBmaestro - Database DevOps
 
PPTX
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Steve Kessler
 
PDF
Infrastructure as Code Maturity Model v1
Gary Stafford
 
PPTX
Introducing Serena Dimensions CM 14, Discussion and product demonstration (We...
Serena Software
 
PPTX
What's new in SBM 11.1
Serena Software
 
PDF
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
Kellyn Pot'Vin-Gorman
 
PDF
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
NCCOMMS
 
PDF
AD1545 - Extending the XPages Extension Library
paidi_ed
 
PDF
DevOps for the DBA
Grant Fritchey
 
PPTX
Learning from the Early Adopters of DevOps: A Guidebook to Success featuring ...
Perforce
 
PPTX
Iltam database version control
uridbmaestro
 
PDF
Alibaba Cloud Conference 2016 - Docker Open Source
John Willis
 
PPT
software technology benchmarking
Mallikarjuna G D
 
PDF
Introduction to SQL Server in Containers
Grant Fritchey
 
PDF
SDL Trados Studio 2014... what's new?
SDL Trados
 
PPTX
Top 10 dev ops tools (1)
yalini97
 
PDF
QualiSystems-Brief TestShell
Amy Ho, PMP, PMI-ACP
 
VSTS Migration Briefing
Angela Dugan
 
Overview and Demonstration of Dimensions CM 14.2 (FUG presentation track 2)
Serena Software
 
Agile Secure Cloud Application Development Management
Adam Getchell
 
The Future of Change Management and DevOps for Dummies
DBmaestro - Database DevOps
 
Resources for Navigating Drupal Upgrades: Versions 6 Through 8 And What It Me...
Steve Kessler
 
Infrastructure as Code Maturity Model v1
Gary Stafford
 
Introducing Serena Dimensions CM 14, Discussion and product demonstration (We...
Serena Software
 
What's new in SBM 11.1
Serena Software
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
Kellyn Pot'Vin-Gorman
 
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
NCCOMMS
 
AD1545 - Extending the XPages Extension Library
paidi_ed
 
DevOps for the DBA
Grant Fritchey
 
Learning from the Early Adopters of DevOps: A Guidebook to Success featuring ...
Perforce
 
Iltam database version control
uridbmaestro
 
Alibaba Cloud Conference 2016 - Docker Open Source
John Willis
 
software technology benchmarking
Mallikarjuna G D
 
Introduction to SQL Server in Containers
Grant Fritchey
 
SDL Trados Studio 2014... what's new?
SDL Trados
 
Top 10 dev ops tools (1)
yalini97
 
QualiSystems-Brief TestShell
Amy Ho, PMP, PMI-ACP
 

Viewers also liked (20)

PPTX
Extending Your Availability Group for Disaster Recovery
Ed Leighton-Dick
 
PPTX
Understanding SQL Server 2016 Always Encrypted
Ed Leighton-Dick
 
PPTX
Dammit Jim! Dr McCoy’s Field Guide to system_health (and the default trace)
Ed Leighton-Dick
 
PDF
Comarch Paiement Mobile
Comarch SAS
 
PDF
Slide of the Month - Payment cards in Nigeria
Marc Zander
 
PPTX
CI/CD/DevOps 使用 travis ci 服務
Yu Lung Shao
 
PPTX
PayPalアカウントを使った便利で安心なプラットフォーム運用
Junichi Okamura
 
PPTX
Iot_algyan_hands-on_20161129
Junichi Okamura
 
PPTX
Paradigm shift in CI at PayPal with Docker and Mesos
Sathiya Narayanan
 
PDF
PayPal MasterBrand Guidelines
Bill Smith
 
PPTX
Tokyo nodefestival workshop_20161112
Junichi Okamura
 
PPTX
The Future of Payments: Next-Gen Payment Processing Technologies
Dustin Lichey, PRM
 
PDF
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
PDF
Introducing Apache Mesos
Matthias Furrer
 
PDF
Jenkins в docker in mesos in ...
Кирилл Толкачёв
 
PPTX
Accelerate Sitecore DevOps on Microsoft Azure
Perficient, Inc.
 
PDF
Most promising current and future payment technologies | SG Analytics
SG Analytics
 
PDF
DevOps with Chef
Kellton Tech Solutions Ltd
 
PDF
GUUG FFG 2017 - DevOps for Everybody - How the entire company can benefit fro...
Schlomo Schapiro
 
PDF
Automate with Ansible basic (3/e)
Chu-Siang Lai
 
Extending Your Availability Group for Disaster Recovery
Ed Leighton-Dick
 
Understanding SQL Server 2016 Always Encrypted
Ed Leighton-Dick
 
Dammit Jim! Dr McCoy’s Field Guide to system_health (and the default trace)
Ed Leighton-Dick
 
Comarch Paiement Mobile
Comarch SAS
 
Slide of the Month - Payment cards in Nigeria
Marc Zander
 
CI/CD/DevOps 使用 travis ci 服務
Yu Lung Shao
 
PayPalアカウントを使った便利で安心なプラットフォーム運用
Junichi Okamura
 
Iot_algyan_hands-on_20161129
Junichi Okamura
 
Paradigm shift in CI at PayPal with Docker and Mesos
Sathiya Narayanan
 
PayPal MasterBrand Guidelines
Bill Smith
 
Tokyo nodefestival workshop_20161112
Junichi Okamura
 
The Future of Payments: Next-Gen Payment Processing Technologies
Dustin Lichey, PRM
 
CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos
Carlos Sanchez
 
Introducing Apache Mesos
Matthias Furrer
 
Jenkins в docker in mesos in ...
Кирилл Толкачёв
 
Accelerate Sitecore DevOps on Microsoft Azure
Perficient, Inc.
 
Most promising current and future payment technologies | SG Analytics
SG Analytics
 
DevOps with Chef
Kellton Tech Solutions Ltd
 
GUUG FFG 2017 - DevOps for Everybody - How the entire company can benefit fro...
Schlomo Schapiro
 
Automate with Ansible basic (3/e)
Chu-Siang Lai
 
Ad

Similar to DevOps+Data: Working with Source Control (20)

PPTX
#DOAW16 - DevOps@work Roma 2016 - Databases under source control
Alessandro Alpi
 
PPTX
Part of the DLM story: Get your Database under Source Control - SQL In The City
Red Gate Software
 
PPTX
Database CI/CD Pipeline
muhammadhashir57
 
PPTX
Bringing DevOps to the Database
Michaela Murray
 
PPTX
Steve Jones - Team-based Version Control
Red Gate Software
 
PPTX
Redgate Database Devops Demo webinar - Visual Studio Team Services - 21st Fe...
KateDuggan2
 
PPTX
Extending DevOps practices to SQL Server databases - branching & merging with...
Red Gate Software
 
PDF
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
PDF
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
Tobias Koprowski
 
PPTX
Extending DevOps practices to SQL Server databases - story tracking - 20th ju...
Red Gate Software
 
PDF
SQL Server Source Control Basics
Kesavan Munuswamy
 
PDF
Get Your Database Under Control
Grant Fritchey
 
PPTX
Sql source control
AndyPickett
 
PPTX
manage databases like codebases
DBmaestro - Database DevOps
 
PDF
SQL Server DevOps Jumpstart
Ori Donner
 
PPTX
The Challenges & Pitfalls of Database Continuous Delivery
Perforce
 
PDF
Database Source Control
Dean Willson
 
PPTX
Continuous database deployment
Mike (Michael) Acord
 
PPTX
Dbops, DevOps & Ops, by Eduardo Piairo
Agile Connect®
 
PDF
Road to database automation: database source control
Eduardo Piairo
 
#DOAW16 - DevOps@work Roma 2016 - Databases under source control
Alessandro Alpi
 
Part of the DLM story: Get your Database under Source Control - SQL In The City
Red Gate Software
 
Database CI/CD Pipeline
muhammadhashir57
 
Bringing DevOps to the Database
Michaela Murray
 
Steve Jones - Team-based Version Control
Red Gate Software
 
Redgate Database Devops Demo webinar - Visual Studio Team Services - 21st Fe...
KateDuggan2
 
Extending DevOps practices to SQL Server databases - branching & merging with...
Red Gate Software
 
The future of DevOps: fully left-shifted deployments with version control and...
Red Gate Software
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
Tobias Koprowski
 
Extending DevOps practices to SQL Server databases - story tracking - 20th ju...
Red Gate Software
 
SQL Server Source Control Basics
Kesavan Munuswamy
 
Get Your Database Under Control
Grant Fritchey
 
Sql source control
AndyPickett
 
manage databases like codebases
DBmaestro - Database DevOps
 
SQL Server DevOps Jumpstart
Ori Donner
 
The Challenges & Pitfalls of Database Continuous Delivery
Perforce
 
Database Source Control
Dean Willson
 
Continuous database deployment
Mike (Michael) Acord
 
Dbops, DevOps & Ops, by Eduardo Piairo
Agile Connect®
 
Road to database automation: database source control
Eduardo Piairo
 
Ad

More from Ed Leighton-Dick (7)

PPTX
SQL Server: Now It's Everywhere You Want to Be
Ed Leighton-Dick
 
PPTX
How to Keep Your Databases Secure in Just Minutes a Day
Ed Leighton-Dick
 
PPTX
Protecting Your Data with Encryption
Ed Leighton-Dick
 
PPTX
SQL Server Features That Will Blow Your Mind!
Ed Leighton-Dick
 
PPTX
Get Involved!
Ed Leighton-Dick
 
PPTX
Service Broker: The Queue Continuum
Ed Leighton-Dick
 
PPTX
Practically Normal: An Introduction to Normalization
Ed Leighton-Dick
 
SQL Server: Now It's Everywhere You Want to Be
Ed Leighton-Dick
 
How to Keep Your Databases Secure in Just Minutes a Day
Ed Leighton-Dick
 
Protecting Your Data with Encryption
Ed Leighton-Dick
 
SQL Server Features That Will Blow Your Mind!
Ed Leighton-Dick
 
Get Involved!
Ed Leighton-Dick
 
Service Broker: The Queue Continuum
Ed Leighton-Dick
 
Practically Normal: An Introduction to Normalization
Ed Leighton-Dick
 

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
PPTX
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PPTX
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Hyderabad MuleSoft In-Person Meetup (June 21, 2025) Slides
Ravi Tamada
 
Smart Factory Monitoring IIoT in Machine and Production Operations.pptx
Rejig Digital
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
01_Approach Cyber- DORA Incident Management.pptx
FinTech Belgium
 
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
 
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Next level data operations using Power Automate magic
Andries den Haan
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 

DevOps+Data: Working with Source Control

  • 1. DEVOPS+DATA: WORKING WITH SOURCE CONTROL Ed Leighton-Dick
  • 2. ABOUT ME Email: [email protected] Blog: edleightondick.com Twitter: @eleightondick
  • 3. GOALS • Understand DevOps • Understand source control • How to apply source control to data
  • 5. WHAT IS DEVOPS? • “DevOps is the practice of operations and development engineers participating together in the entire service lifecycle, from design through the development process to production support.” • Corollary: “DevOps is also characterized by operations staff making use [of] many of the same techniques as developers for their systems work.” Source: https://theagileadmin.com/what-is-devops/
  • 6. WHAT IS DEVOPS? • Incorporates • Structured processes favored by operations • Flexibility favored by developers • Built around consistent processes and practices • Evolved from need to better support Agile • Often includes Continuous Integration/Continuous Delivery
  • 7. WHAT’S THE BIG DEAL? • Improved communication and collaboration • Improved productivity and efficiency • More regular, more consistent software updates • Improved software quality • Reduced time to recover from failed releases • Lower risk
  • 8. STAGES • Code • Build • Verify • Package • Release • Configure • Monitor Image Credit: By Kharnagy - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=51215412
  • 9. DEVOPS+DATA • Databases are harder to automate • Shared resource • Code mixed in with data • Mix of static and dynamic data • Objects must be modified, not simply replaced • Databases are integral components of most applications
  • 11. SOURCE CONTROL • Practices and supporting systems that support the management of changes to application code • Stores history of changes • Facilitates merging of conflicting changes • AKA: version control, source management, revision control
  • 12. TYPES OF SOURCE CONTROL • Centralized • PVCS • Microsoft Visual Source Safe • Microsoft Team Foundation Server • Subversion (SVN) • Distributed • Git • Mercurial
  • 13. COMPARISON Centralized • One snapshot + deltas • Working copy = Most recent version • Work solely on central repository • One source of truth Distributed • Git: Snapshots • Working copy = Full copy of repository • Work primarily with local repository • ??
  • 14. TRADITIONAL • Repository • Working folder • Check-out and check-in • Commits • Branching and merging
  • 15. DISTRIBUTED • Repository • Local repository • Cloning • Pull • Push • Branching and merging
  • 17. VCS+DATA • Databases should be included in source control • Database code = Application code • Static data = Application code • Most applications cannot run without their database(s)
  • 18. VCS+DATA • Database professionals have been slow to adopt source control • Many DBAs have no development experience • Lack of communication about why • Lack of communication/inclusion with development teams • Migration vs deployment • Lack of pre-built tools to facilitate complex database changes
  • 19. VCS+DATA: WHY NOW? • The situation has changed • Modern tools now exist to facilitate technical side • DevOps changes the conversation
  • 20. VCS+DATA MODELS • Schema-only • Changes-only • Hybrid
  • 21. THE SCHEMA-ONLY MODEL • Code for all database objects stored • Mirrors model used by most application code • Can produce a clean copy of a specific version of a database • Cannot migrate to a new version of a database without help • Used by… • Roll-your-own • Most third-party tools* - Microsoft, Redgate, ApexSQL, DBMaestro
  • 22. THE CHANGES-ONLY MODEL • Scripts to upgrade between versions are stored • Scripts to create a clean copy may not be stored • Used by… • Roll-your-own (very common)
  • 23. THE HYBRID MODEL • Stores scripts used to create objects • Stores scripts used to migrate between versions • Used by… • Redgate SQL Source Control (with migration scripts) • Redgate ReadyRoll • Others?
  • 24. FIRST THINGS FIRST… • All changes must be saved to source control for source control to be useful • Database cannot enforce this – Unaware of source control • Source control cannot enforce this – Unaware of changes • External tools may be able to monitor but cannot yet enforce – No control over database or source control • Cannot move further in DevOps without good source control
  • 25. FIRST THINGS FIRST… • Decide on your process before implementing tools • What objects are saved to source control? • What changes are saved? • Who saves changes? • How often? • Who/what will enforce process? How?
  • 26. SHARED VS DEDICATED • Two models for working with development databases • Shared • Dedicated
  • 27. SHARED DEVELOPMENT MODEL • Data kept in central location • More efficient from technical perspective • Less disk space • Less management overhead • Developers must be concerned with conflicts with each others’ work • Integration done at time of development • Refreshing can be difficult
  • 28. DEDICATED DEVELOPMENT MODEL • Each developer has their own copy of the database • Developer is able to work more efficiently • No conflicts with other developers’ work • Copy of database is stored locally in many cases • Data is more easily refreshed • Integration occurs between development and testing • Concerns • Transporting and storage of large databases • Security of data • Management overhead
  • 29. WHICH IS BETTER? • No right answer • Often dictated by circumstances • My preference: As close to dedicated as possible • Redgate SQL Clone can help facilitate refreshing, management • Solves some problems • Still requires connection to central image
  • 30. RELEASING CHANGES • The problem: How do we generate the deltas that matter to us? • Source control deltas = Differences between stored versions (Not useful for migrations) • Databases require change scripts of some sort
  • 31. TOOLS • Microsoft Visual Studio Database Projects • Feature of Visual Studio • Developers works with creation scripts, rather than directly with database • “Declarative database development” model • Schema Comparison used to generate change scripts
  • 32. TOOLS • Redgate approaches • SQL Source Control • More “behind the scenes” than database projects • Integrated into SQL Server Management Studio • Uses SQL Compare to generate change scripts at time of release • Manually-created migration scripts override generated change scripts • ReadyRoll • Integrated into Visual Studio • Uses SQL Compare to generate migration scripts at time of commit • Edit generated migration scripts to override
  • 33. DEMO
  • 34. BEST PRACTICES • Make database source control part of your team’s standard development process • Don’t make it only the DBA’s responsibility • One object/change per file • Check-in changes on a regular basis • Find a solution that integrates with what your developers already use • Don’t allow code changes outside of the process • Store the database build number in the database
  • 36. GOALS • Understand DevOps • Understand source control • How to apply source control to data
  • 38. THANK YOU FOR ATTENDING! ~ Please remember to fill out your comment cards ~