Ike Ellis, MVP, Crafting Bytes
14 Habits of Great
SQL Developers
Things you can do to increase
your value to everyone
Please silence
cell phones
Please silence
cell phones
2
Free online webinar
events
Free 1-day local
training events
Local user groups
around the world
Online special
interest user groups
Business analytics
training
Free Online Resources
PASS Blog
White Papers
Session Recordings
Newsletter www.pass.org
Explore everything PASS has to offer
PASS Connector
BA Insights
Get involved
Session evaluations
Download the GuideBook App
and search: PASS Summit 2017
Follow the QR code link
displayed on session signage
throughout the conference
venue and in the program guide
Your feedback is important and valuable.
Go to passSummit.com
Submit by 5pm Friday, November 10th to win prizes. 3 Ways to Access:
Ike Ellis
Partner, Crafting Bytes
Microsoft MVP
Since 2011
Frequent PASS Summit Speaker
And speak often at SQL Saturdays + maker
of youtube videos – Ike’s tips!
Author of Developing Azure
Solutions
Now in 2nd Edition
/ikeellis @ike_ellis ellisike
• Things great SQL developers have in common
• Great for all developers, not just SQL developers
• In order to benefit you, not benefit me.
• #1, #2, #3 are by far the most important
• This isn’t a performance lesson
• This isn’t a SQL internals lesson
• This isn’t a SQL language best practices lesson
• This is a discussion on the personal habits and characteristics and thought
patterns of great SQL developers.
Habit #1: Use Source Control
• Provides history
• Allows for checkin comments
• Provides rollback point
• Provides point for software deployment
• Effectively shares code with team
• Shows management the work being done
• Shows tests being written
• Ties code into work items which preserves coding intent
• Job isn’t done until checkin
• Checkin early, often, and when in doubt, checkin again
• Merge as early as possible. Merge often.
Habit #2: Test, test, and test again
Habit #2: Testing benefits
• Preserves intent
• Forces single purpose stored procedures because
they are testable
• Folds into source control and runs before any build
• Helps avoid mistakes from re-entering the source
code months or years down the line
• Initial and second most important building block that
allows all sorts of power like continuous integration,
continuous deployment,
• Surface mistakes quickly and in development, not in
production
Habit #2: Testing Best Practices
• Use mocking frameworks, begin tran, action, rollback tran, mock data
• Never use production data
• Love all testing frameworks
• tSQLt
• Visual Studio
• NUnit
• SpecFlow – BDD testing
• Cucumber/Gerkin
• ApprovalTests
• At minimum, test that the sprocs, views, and functions actually run with
the right arguments
Habit #3:
Habit #3: Always Be Shipping
• Automate, automate, automate
• Fold tests into deployment process
• Learn a scripting language
• PowerShell
• Azure CLI
• Grant Fritchey says!
• Never change an object in production directly
• Always go through the deployment pipeline
Habit #4: Question, Re-Evaluate, Act
• Question your own preconceived notions
• Question your own biases
• Question the purpose of new technology
• Question your own derived answers
• Evaluate effect on previous decisions
• Change your mind and behavior
Habit #5:
Habit #5:
• Understand The Real Job
• Not to write code, but deliver value
• Can it all be done in Excel? InfoPath? Power Apps?
• It’s more fun to delete code.
• Deliver as fast as you can.
Habit #6: Software development, at its
most fun, is a team sport
• Code reviews
• Share all information
• Teach technology
• Teach habits and practices
• Teach domain knowledge
• Teach code frameworks and architecture
• Disseminate information at every available opportunity
• Mob Programming
Habit #6: Software development, at its
most fun, is a team sport
Habit #6: Software development, at its
most fun, is a team sport
Habit #6: Software development, at its
most fun, is a team sport
• Focus on a single task
• Complete it
• Test it
• Verify functionality and impact on other systems
• Check in
• Deploy if possible
• Work on next item
• Avoid silos
Habit #7: Fight dependencies
Habit #7: Fight dependencies
• Normalizing and denormalizing and changing the data model is
essential to a good application
• Necessary for performance
• Necessary to represent changes in the business
• Necessary to remove dead features
• Necessary to make data exploration and analysis much easier
• Necessary to speed application development
• T-SQL code is the ultimate dependency
• Should be isolated so schema can change
• Schema can stay vibrant and relevant
Habit #7: Fight dependencies
• Avoid change lock
• Happens because of dependencies
• Lack of testing
• Complicated code
• Loss of intent
Habit #7: Fight dependencies
• Views
• Stored Procedures
• Functions
• ORMs
• Web APIs ~ REST, SOAP, etc
• Come through the front door. Give them an API
• Can cause the use of triggers.
• EDA – ODS, DW, DM
• Never allow direct access to your tables for anything
• Adds initial time to development, but keeps the application
changeable and flexible
Habit #7: Fight dependencies
• One application ~ one database
• Or at least one software development team, one database
• Fight three part names
• Database.dbo.tablename
• Or even worse, four part names
• Servername.database.dbo.tablename
• But if you’re going to use four part names
• Use DNS Alias (CNAME)
• Use Views/Stored Procedures
• Keep the coding contract firm and clear
• Preferable to use Web API/C#/JS
Habit #8: Code for resiliency/code for cloud
• Error handling
• Flag
• Fix
• Fail
• Connection retry
• Short transactions
• Deliberate rollback tran
• Table update order document
Habit #9: Love your tools
• Know every option
• Know keystrokes and shortcuts
• Know code navigation
• Know these tools:
• SQL Prompt
• Visual Studio
• SSMS
• Profiler
• Extended Events
• MS Excel
Habit #10: Love your language
• SQL is a command language
• Think like the optimizer
• Learn new features:
• CONCAT
• TRY_CAST
• Window Functions
• Memory Optimized Tables and Procedures
• Columnstore
• DROP IF EXISTS
• R
• Python
• JSON
Habit #11: High-performance is not created by accident
• But it can be created at the last responsible moment
• Key to performance is to watch dependencies
• Think always about concurrency
• Small things are changeable and scalable
• Think cloud-scale+
Habit #12:
Habit #12: Leave it better than you found it
• Long stored procedures are the bane of the great developer
• Not testable
• Hard to change
• Bad for performance
• Prone to bugs
• Prone to have developers avoid understanding it
• Hard to navigate
• Motorcycle vs Semi-truck
Habit #12: Leave it better than you found it
• Update and repair ~ weed the garden – constantly
• Bad developers work to get the item off their plate so they can do
something else
• Great developers work so that the item is more enjoyable to work
on when they’re asked again
Habit #13:
Habit #13: Respond with a sense of urgency
• Treat it as their most valuable commodity
• Things that erode user trust:
• Repeated mistakes
• Half-done code
• Bugs surfacing at run-time
• Missed deadlines
• Bad listening skills
• Not reading the entire email
• Things that gain user trust
• Doing what you said you do when you said you’d do it
• Digging deeper to understand and empathize
• Doing their work with them, not for them
Habit #14: Time as the most valuable commodity
• Record victories in excel, google doc, or better yet: Toggl
• Think about time doing plumbing and maintenance
• Merging, branching
• In meetings
• Moving code to production
• Maintenance tasks
• Repeated tasks
• Take ownership of their habits and their time
• Make things happen, not happen to them
PRIZES TO GIVE AWAY!
• Next week I’ll ship 10 posters to winners
• Just give me your business card and pick which poster you want. I’ll
send it to you.
Thank You
Learn more from Ike Ellis
ike@craftingbytes.com@ike_ellis
ALL DONE!
Ike Ellis
@ike_ellis
Crafting Bytes
We’re hiring a Data Experts!
Microsoft MVP
Chairperson of the San Diego TIG
Book co-author – Developing Azure Solutions
Upcoming course on Azure Data Lake
www.craftingbytes.com
www.ikeellis.com

14 Habits of Great SQL Developers

  • 1.
    Ike Ellis, MVP,Crafting Bytes 14 Habits of Great SQL Developers Things you can do to increase your value to everyone
  • 2.
    Please silence cell phones Pleasesilence cell phones 2
  • 3.
    Free online webinar events Free1-day local training events Local user groups around the world Online special interest user groups Business analytics training Free Online Resources PASS Blog White Papers Session Recordings Newsletter www.pass.org Explore everything PASS has to offer PASS Connector BA Insights Get involved
  • 4.
    Session evaluations Download theGuideBook App and search: PASS Summit 2017 Follow the QR code link displayed on session signage throughout the conference venue and in the program guide Your feedback is important and valuable. Go to passSummit.com Submit by 5pm Friday, November 10th to win prizes. 3 Ways to Access:
  • 5.
    Ike Ellis Partner, CraftingBytes Microsoft MVP Since 2011 Frequent PASS Summit Speaker And speak often at SQL Saturdays + maker of youtube videos – Ike’s tips! Author of Developing Azure Solutions Now in 2nd Edition /ikeellis @ike_ellis ellisike
  • 6.
    • Things greatSQL developers have in common • Great for all developers, not just SQL developers • In order to benefit you, not benefit me. • #1, #2, #3 are by far the most important • This isn’t a performance lesson • This isn’t a SQL internals lesson • This isn’t a SQL language best practices lesson • This is a discussion on the personal habits and characteristics and thought patterns of great SQL developers.
  • 7.
    Habit #1: UseSource Control • Provides history • Allows for checkin comments • Provides rollback point • Provides point for software deployment • Effectively shares code with team • Shows management the work being done • Shows tests being written • Ties code into work items which preserves coding intent • Job isn’t done until checkin • Checkin early, often, and when in doubt, checkin again • Merge as early as possible. Merge often.
  • 8.
    Habit #2: Test,test, and test again
  • 9.
    Habit #2: Testingbenefits • Preserves intent • Forces single purpose stored procedures because they are testable • Folds into source control and runs before any build • Helps avoid mistakes from re-entering the source code months or years down the line • Initial and second most important building block that allows all sorts of power like continuous integration, continuous deployment, • Surface mistakes quickly and in development, not in production
  • 10.
    Habit #2: TestingBest Practices • Use mocking frameworks, begin tran, action, rollback tran, mock data • Never use production data • Love all testing frameworks • tSQLt • Visual Studio • NUnit • SpecFlow – BDD testing • Cucumber/Gerkin • ApprovalTests • At minimum, test that the sprocs, views, and functions actually run with the right arguments
  • 11.
  • 12.
    Habit #3: AlwaysBe Shipping • Automate, automate, automate • Fold tests into deployment process • Learn a scripting language • PowerShell • Azure CLI • Grant Fritchey says! • Never change an object in production directly • Always go through the deployment pipeline
  • 13.
    Habit #4: Question,Re-Evaluate, Act • Question your own preconceived notions • Question your own biases • Question the purpose of new technology • Question your own derived answers • Evaluate effect on previous decisions • Change your mind and behavior
  • 14.
  • 15.
    Habit #5: • UnderstandThe Real Job • Not to write code, but deliver value • Can it all be done in Excel? InfoPath? Power Apps? • It’s more fun to delete code. • Deliver as fast as you can.
  • 16.
    Habit #6: Softwaredevelopment, at its most fun, is a team sport • Code reviews • Share all information • Teach technology • Teach habits and practices • Teach domain knowledge • Teach code frameworks and architecture • Disseminate information at every available opportunity • Mob Programming
  • 17.
    Habit #6: Softwaredevelopment, at its most fun, is a team sport
  • 18.
    Habit #6: Softwaredevelopment, at its most fun, is a team sport
  • 19.
    Habit #6: Softwaredevelopment, at its most fun, is a team sport • Focus on a single task • Complete it • Test it • Verify functionality and impact on other systems • Check in • Deploy if possible • Work on next item • Avoid silos
  • 20.
    Habit #7: Fightdependencies
  • 21.
    Habit #7: Fightdependencies • Normalizing and denormalizing and changing the data model is essential to a good application • Necessary for performance • Necessary to represent changes in the business • Necessary to remove dead features • Necessary to make data exploration and analysis much easier • Necessary to speed application development • T-SQL code is the ultimate dependency • Should be isolated so schema can change • Schema can stay vibrant and relevant
  • 22.
    Habit #7: Fightdependencies • Avoid change lock • Happens because of dependencies • Lack of testing • Complicated code • Loss of intent
  • 23.
    Habit #7: Fightdependencies • Views • Stored Procedures • Functions • ORMs • Web APIs ~ REST, SOAP, etc • Come through the front door. Give them an API • Can cause the use of triggers. • EDA – ODS, DW, DM • Never allow direct access to your tables for anything • Adds initial time to development, but keeps the application changeable and flexible
  • 24.
    Habit #7: Fightdependencies • One application ~ one database • Or at least one software development team, one database • Fight three part names • Database.dbo.tablename • Or even worse, four part names • Servername.database.dbo.tablename • But if you’re going to use four part names • Use DNS Alias (CNAME) • Use Views/Stored Procedures • Keep the coding contract firm and clear • Preferable to use Web API/C#/JS
  • 25.
    Habit #8: Codefor resiliency/code for cloud • Error handling • Flag • Fix • Fail • Connection retry • Short transactions • Deliberate rollback tran • Table update order document
  • 26.
    Habit #9: Loveyour tools • Know every option • Know keystrokes and shortcuts • Know code navigation • Know these tools: • SQL Prompt • Visual Studio • SSMS • Profiler • Extended Events • MS Excel
  • 27.
    Habit #10: Loveyour language • SQL is a command language • Think like the optimizer • Learn new features: • CONCAT • TRY_CAST • Window Functions • Memory Optimized Tables and Procedures • Columnstore • DROP IF EXISTS • R • Python • JSON
  • 28.
    Habit #11: High-performanceis not created by accident • But it can be created at the last responsible moment • Key to performance is to watch dependencies • Think always about concurrency • Small things are changeable and scalable • Think cloud-scale+
  • 29.
  • 30.
    Habit #12: Leaveit better than you found it • Long stored procedures are the bane of the great developer • Not testable • Hard to change • Bad for performance • Prone to bugs • Prone to have developers avoid understanding it • Hard to navigate • Motorcycle vs Semi-truck
  • 31.
    Habit #12: Leaveit better than you found it • Update and repair ~ weed the garden – constantly • Bad developers work to get the item off their plate so they can do something else • Great developers work so that the item is more enjoyable to work on when they’re asked again
  • 32.
  • 33.
    Habit #13: Respondwith a sense of urgency • Treat it as their most valuable commodity • Things that erode user trust: • Repeated mistakes • Half-done code • Bugs surfacing at run-time • Missed deadlines • Bad listening skills • Not reading the entire email • Things that gain user trust • Doing what you said you do when you said you’d do it • Digging deeper to understand and empathize • Doing their work with them, not for them
  • 34.
    Habit #14: Timeas the most valuable commodity • Record victories in excel, google doc, or better yet: Toggl • Think about time doing plumbing and maintenance • Merging, branching • In meetings • Moving code to production • Maintenance tasks • Repeated tasks • Take ownership of their habits and their time • Make things happen, not happen to them
  • 35.
    PRIZES TO GIVEAWAY! • Next week I’ll ship 10 posters to winners • Just give me your business card and pick which poster you want. I’ll send it to you.
  • 36.
    Thank You Learn morefrom Ike Ellis ike@craftingbytes.com@ike_ellis
  • 37.
    ALL DONE! Ike Ellis @ike_ellis CraftingBytes We’re hiring a Data Experts! Microsoft MVP Chairperson of the San Diego TIG Book co-author – Developing Azure Solutions Upcoming course on Azure Data Lake www.craftingbytes.com www.ikeellis.com