team-based development with version control
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/1.jpg)
Team-based Development withVersion Control
Grant FritcheyRed Gate Software
#sqlinthecity
![Page 2: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/2.jpg)
Goals
• The value of version control• Standards, patterns and best practices• Flow in a team
![Page 3: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/3.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/4.jpg)
How many of you use version control for you
application code?database
![Page 5: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/5.jpg)
![Page 6: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/6.jpg)
![Page 7: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/7.jpg)
![Page 8: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/8.jpg)
![Page 9: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/9.jpg)
“If it’s not in source control, it doesn’t exist.”
![Page 10: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/10.jpg)
“…your database should always be under source control right next to your application code.”
![Page 11: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/11.jpg)
The Best Reason
‘Use source control because neither you nor your team
are perfect”
![Page 12: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/12.jpg)
![Page 13: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/13.jpg)
Getting started with databases in VCS
Demo
![Page 14: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/14.jpg)
![Page 15: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/15.jpg)
Reducing Risk
![Page 16: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/16.jpg)
You’re using version control
![Page 17: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/17.jpg)
You’re using version control
![Page 18: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/18.jpg)
Use Something
![Page 19: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/19.jpg)
Automation is Best
![Page 20: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/20.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/21.jpg)
Dedicated or Shared Databases?
![Page 22: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/22.jpg)
Shared databases are not wrong
![Page 23: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/23.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/24.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/25.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/26.jpg)
Teamwork
![Page 27: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/27.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/28.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/29.jpg)
The flow within teams.
Demo
![Page 30: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/30.jpg)
Get All Your Code
• Object DDL• Assembly code• Security code• Configuration settings• Jobs• Lookup data
![Page 31: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/31.jpg)
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](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/32.jpg)
The Holy Grail
![Page 33: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/33.jpg)
Goals
• The value of version control• Standards, patterns and best practices• Flow in a team
![Page 34: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/34.jpg)
The End
• The next step is Automated Test and Build (next session)
• Questions?
![Page 35: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/35.jpg)
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
![Page 36: Team-based Development with Version Control](https://reader038.vdocuments.us/reader038/viewer/2022110309/558524c4d8b42aea748b50cd/html5/thumbnails/36.jpg)
Images
• http://northernalberta.rims.org/NorthernAlbertaChapter/Home/
• http://indianajones.wikia.com/wiki/Holy_Grail• http://www.youtube.com/watch?v=RG0ochx16Dg• http://www.flickr.com/photos/lumaxart/213773724
8/