steve jones - team-based version control

33
Team-based Database Development with Version Control Steve Jones Editor in Chief SQL Server Central, Red Gate Software #sqlinthecity

Upload: red-gate-software

Post on 06-Feb-2015

300 views

Category:

Technology


0 download

DESCRIPTION

Steve Jones - Team-based Version Control @ SQL In The City, London

TRANSCRIPT

Page 1: Steve Jones - Team-based Version Control

Team-based Database Development with Version Control

Steve JonesEditor in Chief

SQL Server Central, Red Gate Software

#sqlinthecity

Page 2: Steve Jones - Team-based Version Control

Goals

• Understand why version control is important?

• Learn some standards, patterns and best practices

• See flow in a team

Page 3: Steve Jones - Team-based Version Control
Page 4: Steve Jones - Team-based Version Control

Getting started with databases in VCS

DemoDemo

Page 5: Steve Jones - Team-based Version Control
Page 6: Steve Jones - Team-based Version Control
Page 7: Steve Jones - Team-based Version Control
Page 8: Steve Jones - Team-based Version Control
Page 9: Steve Jones - Team-based Version Control

If it’s not in source control, it doesn’t exist.

Page 10: Steve Jones - Team-based Version Control

…your database should always be under source control right next to your application code.

Page 11: Steve Jones - Team-based Version Control
Page 12: Steve Jones - Team-based Version Control

Reducing Risk

Page 13: Steve Jones - Team-based Version Control

The Best Reason

Use source control because neither you nor your team

are perfect

Page 14: Steve Jones - Team-based Version Control

Use Something

Page 15: Steve Jones - Team-based Version Control

Automation is Best

Page 16: Steve Jones - Team-based Version Control

Agenda

• Why Version Control?• Standards, Patterns and Best Practices• Flow in a Team

Page 17: Steve Jones - Team-based Version Control

Database Code

• Object DDL• Assembly code• Security code• Configuration settings• Jobs• Lookup data

Page 18: Steve Jones - Team-based Version Control

Standards

• Three types of standards – Naming– Style– Process

• All important

Page 19: Steve Jones - Team-based Version Control

Naming Standards

• Usually vary by company• ISO 1179• Be consistent• Use tools for enforcement (SQLCop)• Document these lightly and JIT

Page 20: Steve Jones - Team-based Version Control

Style Standards

• Vary by individual• Make code more readable.• Use tools to re-format code to your liking.– SQL Prompt– SSMS Tools Pack– Others

Page 21: Steve Jones - Team-based Version Control

Rules for Database Development• Never use a shared database for

development• Always Have a Single, Authoritative Source

For Your Schema • Always Version Your Database

Page 23: Steve Jones - Team-based Version Control

The Holy Grail

Page 24: Steve Jones - Team-based Version Control

Developer Efficiency

Demo

Page 25: Steve Jones - Team-based Version Control

Agenda

• Why Version Control?• Standards, Patterns and Best Practices• Flow in a Team

Page 26: Steve Jones - Team-based Version Control

Teamwork

Page 27: Steve Jones - Team-based Version Control

Teamwork

• Communication– Team members need to be aware of

(easily) what others are doing.• Coordination– Teams need to work in a way that

complements each other.

Page 28: Steve Jones - Team-based Version Control

Automation

• Development systems and tools need to work for the team, not against them.

• Many IDEs and tools work well in team environments, if you configure them.

Page 29: Steve Jones - Team-based Version Control

The flow within teams.

Demo

Page 30: Steve Jones - Team-based Version Control

Goals

• Understand why version control is important?

• Learn some standards, patterns and best practices

• See flow in a team

Page 31: Steve Jones - Team-based Version Control

The End

• The next step is Automated Test and Build (next session)

• Questions?• Please fill out your feedback forms• sqlinthecity.red-gate.com• www.voiceofthedba.com.talks• Focus Group on migrations for complex

database changes at 13:30

Page 32: Steve Jones - Team-based Version Control

References

• http://stackoverflow.com/questions/115369/do-you-use-source-control-for-your-database-items

• http://www.codinghorror.com/blog/archives/001050.html• http://www.codinghorror.com/blog/2008/02/get-your-database-under-version-

control.html• http://

www.ssw.com.au/ssw/Standards/Rules/RulesToBetterSQLServerDatabases.aspx• http://

odetocode.com/blogs/scott/archive/2008/01/30/three-rules-for-database-work.aspx

• Check in early, check in often - http://www.codinghorror.com/blog/2008/08/check-in-early-check-in-often.html