Problems displaying this newsletter? View online.
SQL Server Central
Featured Contents
Question of the Day
The Voice of the DBA
 

Using Feature Flags

The use of feature flags in software development has become more and more prevalent over time, especially as teams move to DevOps-style development with frequent releases. I've often thought that using feature flags allows technical people to separate out the deployment of some feature or change from the release of that to users. There are a number of articles on this style of work (feature flag driven development, Why Use Feature Flags?) as well as a discussion at Reddit.

I am a big believer in feature flags helping with improving your software in many ways. These articles (and others) highlight the advantages that a software organization gains by using feature flags. Failed releases become less of an issue, as the specific change that doesn't work can be turned off. This can even work with databases. I can deploy a database change and at a later time have the code (or new table/column) start being used when a feature flag is set. If there is an issue, I can turn off the feature flag and stop using the code (or populating the schema). I can then clean things up, even saving data before I make a change.

I don't love the idea of using feature flags to handle security access to features, which is pointed out in a few places. If this is for testing or evaluation by customers, perhaps. If this is to get access to data from a security standpoint, this is a bad idea. I hope most of you are savvy enough to realize this.

Feature flags are not a panacea for preventing issues. They do clutter up code and make it harder to read. Once a feature is done and permanently enabled, the code for switching flags should be removed. It is also hard to stack versions of features up behind one flag, which can increase coding mistakes. Adding flags in stored procedures or functions also can wreak havoc on query optimizers, so I'd recommend you don't do that. Instead handle feature enablement in the application code and use multiple procs/functions for the different functionality you might need.

To use feature flags appropriately with database changes, you also need to be able to dark deploy those changes, with your application code able to handle additive changes to the database. A new column, a new table, or a new parameter should be easy to add without breaking the app code. This requires the use of defaults as well as good coding practices (no select *, inserts with column lists), but it can be done. Once you are in this place, life becomes a lot less stressful and feature flags work amazingly well.

Steve Jones - SSC Editor

Join the debate, and respond to today's editorial on the forums

 
 Featured Contents
SQLServerCentral Article

Understanding UNION and UNION ALL in SQL Server

omu from SQLServerCentral

A short look at the differences in UNION and UNION ALL in a SELECT query.

Technical Article

Navigating Your Test Data Challenges: Insights and Solutions

Press Release from SQLServerCentral

Join Redgate on May 1st for an insightful webinar cohosted with analyst firm, Bloor Research, featuring independent Senior Analyst Daniel Howard and Redgate's Steve Jones. Discover the biggest test data challenges, the latest approaches like AI synthetic data generation, and how effective test data management can benefit your entire organization. Don't miss out on this opportunity to gain valuable insights and solutions.

External Article

Introduction to GitHub Actions Part 1: Getting Started

Additional Articles from SimpleTalk

This article series will teach you what you need to know to take advantage of GitHub Actions, especially for deploying database code.

Blog Post

From the SQL Server Central Blogs - Don’t Treat Your Data Catalog Like a Data Museum

Joyful Craftsmen from Joyful Craftsmen Blog

Introduction Treating your data catalog like a “data museum”—a static collection where information quietly gathers dust—is a mistake many organizations still make. While a catalog should list what data...

Blog Post

From the SQL Server Central Blogs - The trade-offs associated with low-code solutions

Meagan Longoria from Data Savvy

Low-code solutions often accelerate development and make tasks accessible to people who can’t or don’t want to write their own code. But it’s important to remember that it’s a...

Pro T-SQL 2022: Toward Speed, Scalability, and Standardization for SQL Server Developers

Site Owners from SQLServerCentral

Learn how to write and design simple and efficient T-SQL code. This is a hands-on book that teaches you how to write better T-SQL with examples and straightforward explanations.

 

 Question of the Day

Today's question (by Steve Jones - SSC Editor):

 

The User Login

When I create a user in a SQL Server 2022 database, on which types of logins in the master database can it be based?

Think you know the answer? Click here, and find out if you are right.

 

 

 Yesterday's Question of the Day (by Steve Jones - SSC Editor)

Rolling Back CUs

Can I rollback a cumulative update and remove it from my SQL Server instance?

Answer: Both Windows and Linux support this (with a few restrictions)

Explanation: Both Linux and Windows support this, with certain restrictions on versions of the OS and/or SQL Server. Ref: Uninstall a Cumulative Update - https://learn.microsoft.com/en-us/sql/sql-server/install/uninstall-a-cumulative-update-from-sql-server?view=sql-server-ver16

Discuss this question and answer on the forums

 

 

 

Database Pros Who Need Your Help

Here's a few of the new posts today on the forums. To see more, visit the forums.


SQL Server 2016 - Development and T-SQL
Union where it matches against only one shared column - Hi folks I have two tables, both with a NAME, START and END fields I'd like to list all of the rows from Table A, and then only the rows from Table B where only the START does not exist in Table A.  The NAMES in Table B will ALWAYS be different from those in […]
create a table with data capture for next 3 years - Hello, I would like to build a table capturing data starting from 1st day of current year till next 3 years. Once the table reaches 3 full years, first day of data should fall off as the next day data adds to the table after 3 years. Which means after completion of 3 years, any […]
Administration - SQL Server 2014
sqlagent issue - could not find the procedure msdb.dbo.sp_get_sqlagent_properties agent not visible  
sql agent issue - getting this error. could not find the procedure msdb.dbo.sp_get_sqlagent_properties and also this error cannot find column msdb or user defined function or aggregate msdb.dbo.fn_syspolicy_is_automation_enabled  or name is ambiguous. how to fix this    
SQL Server 2019 - Development
what etl tool are folks moving toward? - Hi as we replace on prem machines , sometimes not with vm's, what should we be thinking about for etl? from my little corner of the world where we use both talend and ssis, and where talend is getting costly, and where ssis is slowly being squeezed into a call from data factory to an […]
How to update using data from three tables? - I am in the process of migrating from MySQL to SQL Server. I have tables like this: create table OldTable ( id int primary key, tagpath varchar(255), retired bigint ) create table DataTable ( tagid int not null, tagValue float ) create table NewTable( id int primary key, tagpath varchar(255), retired bigint ) The DataTable.tagid […]
temp table columns not showing up in CTE - I'm new to the development side of the house and stuck on a CTE issue. In the CTE data is pulled from a temp table. There was a request for more columns, so I added them. Everything works, but the columns don't show up in my CTE results? What am I overlooking here? Thank you […]
Move Files SSIS Task - Hi I have a task in my SSIS package that moves files from source folder to destination folder.  It works if there are no duplicate files being processed.  That is, suppose fileABC.txt is found in both source and destination folder then something went wrong in the processing from earlier SSIS tasks so I want to […]
SQL Azure - Administration
Migrating mission critical database from SQL on Prem to Azure SQL - We are migrating our environments to Azure, it will be a mix of SQL managed instances and Azure SQL instances depending on the different system requirements. We offer realtime service to out clients and need to have minimal downtime hen we make the shift. The first database will be migrated to AzureSQL. Our on prem […]
General
Independent Looking to Expand Knowledge Base - A friend of mine, who has done SQL Saturday presentations, suggested I try my question here. I'm an independent I.T. guy that does some software support on the side, but I'm looking to gradually get out of my current platform.   I'm looking to transition to something else steady and remote, about 5-15 hours/week.  I already […]
Analysis Services
SSAS Cube Migration to Azure cloud - Dear All, I am currently working on a Proof of Concept (POC) where I have developed an SSAS cube with an Oracle (On-prem) source and deployed it to the SSAS server. The SQL DBA team is now planning to migrate the SQL server to the Azure cloud. I would appreciate your suggestions and best practices […]
Anything that is NOT about SQL!
Fantasy Football 2025 - The thread for the league in 2025. Players from last year have priority.
SQL Server 2022 - Administration
How to check if credential password for TDE matches the secret key of Key Vault - Hi all, In my company we have many databases encrypted with TDE and there is some automatic process or pipeline that is not working correctly and updates the secret key in the Key Vault without applying the change also in the credential password in the SQL server. I need some help while we found this […]
SQL Server 2022 - Development
Select Returning Blank Rows - I have the following select statement --#1 Select supplier, s.refnum, desc from supplier as S Where s.refnum = '123456' This brings back records for me. But when I use the field name instead like in #2, I get zero rows --#2 Select supplier, s.refnum, desc from supplier as S where s.refnum in (select refnum from […]
How to update a history table with changes. - Good morning to all.  I am a novice when it comes to SQL so my question is TSQL related on how to update a history table with changes to thousands of records without a cursor. Currently here is my code with cursor. I know I can update the price for all the parts in one […]
 

 

RSS FeedTwitter

This email has been sent to {email}. To be removed from this list, please click here. If you have any problems leaving the list, please contact the webmaster@sqlservercentral.com. This newsletter was sent to you because you signed up at SQLServerCentral.com.
©2019 Redgate Software Ltd, Newnham House, Cambridge Business Park, Cambridge, CB4 0WZ, United Kingdom. All rights reserved.
webmaster@sqlservercentral.com

 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -