team-based development with version control

36
Team-based Development with Version Control Grant Fritchey Red Gate Software #sqlinthecity

Upload: red-gate-software

Post on 20-Jun-2015

1.429 views

Category:

Technology


2 download

DESCRIPTION

Team-based Development with Version Control. Presentation by Grant Fritchey at SQL In The City Cambridge. January 2014.

TRANSCRIPT

Page 1: Team-based Development with Version Control

Team-based Development withVersion Control

Grant FritcheyRed Gate Software

#sqlinthecity

Page 2: Team-based Development with Version Control

Goals

• The value of version control• Standards, patterns and best practices• Flow in a team

Page 3: Team-based Development with Version Control

How many of you use version control for you

application code?

C#, ASP.NET, Javascript, VB.NET, etc.

Page 4: Team-based Development with Version Control

How many of you use version control for you

application code?database

Page 5: Team-based Development with Version Control
Page 6: Team-based Development with Version Control
Page 7: Team-based Development with Version Control
Page 8: Team-based Development with Version Control
Page 9: Team-based Development with Version Control

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

Page 10: Team-based Development with Version Control

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

Page 11: Team-based Development with Version Control

The Best Reason

‘Use source control because neither you nor your team

are perfect”

Page 12: Team-based Development with Version Control
Page 13: Team-based Development with Version Control

Getting started with databases in VCS

Demo

Page 14: Team-based Development with Version Control
Page 15: Team-based Development with Version Control

Reducing Risk

Page 16: Team-based Development with Version Control

You’re using version control

Page 17: Team-based Development with Version Control

You’re using version control

Page 18: Team-based Development with Version Control

Use Something

Page 19: Team-based Development with Version Control

Automation is Best

Page 20: Team-based Development with 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 21: Team-based Development with Version Control

Dedicated or Shared Databases?

Page 22: Team-based Development with Version Control

Shared databases are not wrong

Page 23: Team-based Development with Version Control

The Ideal

Each developer has a dedicated environment with a copy of the schema and minimal data.

A shared integration environment where all developers’ changes are merged, available for developer testing.

Page 24: Team-based Development with Version Control

Naming Standards

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

Page 25: Team-based Development with 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

• Demo – Reformatting code

Page 26: Team-based Development with Version Control

Teamwork

Page 27: Team-based Development with 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: Team-based Development with Version Control

Use 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: Team-based Development with Version Control

The flow within teams.

Demo

Page 30: Team-based Development with Version Control

Get All Your Code

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

Page 31: Team-based Development with Version Control

Best Practices

• Use version control for all code (including tests)

• Commit early, commit often (various references for this one)

• Use tools – If it’s hard, people don’t do it

• Train people• Build often

Page 32: Team-based Development with Version Control

The Holy Grail

Page 33: Team-based Development with Version Control

Goals

• The value of version control• Standards, patterns and best practices• Flow in a team

Page 34: Team-based Development with Version Control

The End

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

• Questions?

Page 35: Team-based Development with 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