Why You Should Treat Your SQL Like Code

DataExpert
Dev Genius
Published in
5 min readJan 8, 2022

For the past 2 years working at a large Silicon Valley technology company, I’ve been observing the way Data Engineers treat SQL the same way Software Engineers treat code. This winning mentality can be integrated into the data strategy of any company of any size. I’m going to walk through the ways that you can benefit from treating SQL like code and provide specific ways that all organizations can benefit from these principles.

SQL is a query language. Why would we treat it like code?

Just like object-oriented code, SQL can be time-intensive to write, laborious to debug, difficult to understand, can cause versioning challenges, and must be maintainable. Speaking from the perspective of one Silicon Valley company; SQL can also be used to create data pipelines. When data pipelines fail, it must be easy and accessible to debug and fix data pipelines. With all of these factors in mind, it’s clear that code centralization must be a core component of data strategy.

With the added benefit of code management tooling, it’s easy to understand who has been changing or maintaining a given SQL script, and trace that author’s changes to other relevant queries. It makes it fast and easy to find failing commits, and revert changes or apply relevant fixes. Upon committing SQL code, the code is instantly deployed to the development environment. Development pipelines can then be executed and failures identified and fixed instantly. Periodically, a testing environment…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Published in Dev Genius

Coding, Tutorials, News, UX, UI and much more related to development

Written by DataExpert

Data Engineering enthusiast, mentor, data geek, passionate about great technology and process

Responses (12)

What are your thoughts?

Data Engineers at Google treat SQL the same way Software Engineers treat code.

Google engineers treat SQL as code because SQL is code.

--

I always treated SQL like code. Not sure why anyone wouldn't.

--

Every IT shop I've worked in treated SQL as part of a project's code base. I am Not sure why Google gets special mention.

--