Settings

Theme

Ask HN: How do you enforce database standards?

3 points by aesthetics1 6 years ago · 5 comments · 1 min read


How does your team ensure that your database standards are being followed? Naming standards, ensuring certain triggers are present, index/constraint rules, etc. Do you use tools, code reviews, or some other method?

I'm finding that this seems to be a harder problem to solve than enforcing other types of coding standards.

davismwfl 6 years ago

Our DB standards are controlled through code, scripts and code reviews. That works fine for smaller teams and is good for us today (we do use DataGrip by JetBrains to help manage/validate our Postgres databases).

There are other tools like Red Gate https://www.red-gate.com/, and others who sell tooling that works on different databases which allow you to automate a lot of standards and deployments etc. Even works for things like data migrations etc. I've used red gate and tools like it on other solutions, a lot of it depends on the architecture and structure of your project.

For example, tools like Red Gate work great when you have DBA's and developers working together to manage databases (datasets) outside of the application code. It is a more traditional method of data solutions. But as seems to happen in tech, we are back to doing things more from the application and managing structure, migrations and standards through application code. There are valid reasons for both methodologies, so a lot just depends on what you are doing and how your team is structured and how big it is.

  • aesthetics1OP 6 years ago

    Thanks for sharing this. I have been evaluating the red gate suite of tools. Is there a particular module in their deployment suite that helps manage/automate standards as you mentioned?

    Our team consists of a single DBA and around a dozen developers. We're a .NET/C# shop but we use Oracle Databases.

    • davismwfl 6 years ago

      On the project we used red gate for we were dealing with a Microsoft shop, so SQL Server. And we used the full suite, including SQL source control which gave hooks for some of our custom scripts to run too, but most of it was doable with the tooling. The software wouldn't catch all policy violations, but what it make it quick for us to fix them when they were found. But in general we were able to automate 98% of the tasks and only deal with true outliers.

      I am not sure with Oracle what is available specifically and it has been a number of years since I worked with redgates tooling, but it was quality stuff. And I remember them being super helpful when we were getting started and answering a ton of questions, so maybe reach out to them with your specifics and see what they have to say. Some things they helped us do were not obvious in their documentation or UX, so it is worth a chat with them.

      • aesthetics1OP 6 years ago

        Thanks a lot for this. I'm in touch with the red gate folks now and I appreciate you sharing your experience.

verdverm 6 years ago

I'm using a sort of ORM, and part of that is making casing consistent. Naming conventions are harder to enforce because this often requires the semantic context to be understood.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection