Achieving global scale and local relevance with feature flags

Global Technology
McDonald’s Technical Blog
5 min readJun 20, 2023

To accommodate McDonald’s global scale, while managing local needs and requirements, we’ve established a feature-flag library to enable flexibility within our Global Mobile App.

by Claire Contos, Feature Activation Supervisor Tech Lead and Golbon Hagan, Senior Product Manager — GMA Channel

Digital is a key part of McDonald’s Accelerating the Arches Strategy — and it’s easy to see why. In our top six markets, digital sales now represent almost 40% of Systemwide sales, seeing more than 30% growth over the last year.

McDonald’s Global Mobile App (GMA), is a core component of our digital platforms, and in 2022, it was downloaded over 40 million times in the U.S.! Simply put, GMA adoption continues to expand, and so will customer expectations for a seamless experience.

GMA’s success continues to motivate the development team and drives us to challenge the status quo in technology to ensure we perform with a focused, cutting-edge mentality in parallel to our customers’ desires.

Even so, there are always opportunities to improve the user experience of the app. Our solution to this is an internal feature-flag library, and a means to improve upon the concept of feature flagging.

In this article, we cover the concept of feature flagging, our current challenges, the benefits and value feature flagging provides, library architecture integration, and what’s to come.

What is feature flagging?
Feature flagging allows channel-delivery leads to enable or disable a component or feature of an app without modifying the source code or requiring redeployment. Commonly referred to as feature or release toggles, feature flags determine (at runtime) which portions of code are executed. This allows new features to be deployed without making them visible to users. Leads can also make them visible to only a specific subset of users or audience.

Due to GMA’s global scale, our apps need to be flexible so they can be configured for different markets that vary in rules, regulations, requirements, and cultural norms. Today, we are customizing market features by using configuration files.

The feature-flag library is pushing us in the right direction on the client-side to re-imagine the way we configure our app.

Below is an example of a code snippet with an if/else statement showcasing the power behind feature flagging:

The image displays a screenshot of a code snippet providing an example of feature flagging. The following JavaScript code displayed includes:   class SampleViewController: UIViewController {  var flagManager: FlagManager = FlagManager.shared  override func viewDidLoad() {  super.viewDidLoad ()  if flagManager.newExampleFlag {  // execute feature code   }   else {   // execute fallback code  }  }  }

Our challenge — release management
Right now, we have thousands of configurable features in GMA on a global scale. A feature is any bit of code, front-end or back-end, that is an individually deliverable component of business value.

Generally, markets decide which features they will individually enable in releases, configured to their unique needs and requirements. The use of configurations for both localizing within markets and release management can lead to complexity in the codebase, which can be challenging for engineers to track and understand the intent of each configuration.

Undefined use of configurations can result in unclear ownership, fragmented releases, and excessive development overhead in managing these configurations. This can cause variations in the timing of feature implementation across markets and make the feature-release process excessively intricate.

Given that markets determine the timing of each release and the availability of its features, we are exploring a method of separating our configuration process, which we expect will offer some efficiencies.

Our solution — an internal feature-flag library
The GMA Platform Product Engineering Team created an internal feature-flagging library — an abstraction tool that allows for flexibility when integrating third-party partners for feature-flag management and enables us to add new providers without having to make extensive changes within our codebase. This practice ensures that scalability and future flexibility remain at the core of our approach.

The feature-flag library provides a quick and efficient way to turn features on or off — as easy as flipping burgers to the desired degree — and an orchestration mechanism to fetch flag values from different remote flag providers. It requires supplementation of an external tool that works in conjunction with the library to enable management of feature flags, experimentation and multi-variant testing with ease, measurement of feature performance, and access control for market stakeholders responsible for feature activation. This allows us to make changes to our core codebase while keeping our configurations separate from our feature flag functionality.

Solution architecture
The following diagram breaks down the architectural structure of how the feature-flag library functions within GMA.

  • Debug Menu: A screen in our non-production test app that allows us to locally make changes to the flag values for testing and validation purposes.
  • The Library: The orchestration layer wraps the third-party software development kit (SDK) and provides an additional layer to fetch flags. The layer bridges the way GMA uses the third-party SDK and maintains the flag values. Essentially, the orchestration layer acts as a wrapper for the SDK.
  • Persistent Store: Saves changes from the Debug Menu, in non-production environments, allowing those values to be maintained locally.
  • Third-Party Provider: A feature flag provider used to manage our flags, turn features on or off for experimentation, and measure performance.
  • Feature Modules: Holds a flag and requests its value from the library.
The image displays a flow diagram of the high-level architecture of the JustFlip feature flagging integration.
Feature-flag library high-level architecture.

Why a feature-flag library?
Feature flags are a software delivery concept that separates feature release from code deployment; it’s a way to deploy a piece of code in production while limiting access — through configuration — to only a subset of users. We plan to integrate a third-party tool to help us achieve feature-flag management to remain agnostic for future enhancements and help prevent having to go through large-scale code changes within our codebase.

Release management value
The tool provides several benefits for market teams. First, it allows them to control the activation of features without needing development support, enabling dark releases, which can help reduce risk and increase confidence in feature releases.

Multivariate testing in production is also made possible with this tool, which lets the team release features more often with confidence. This is achieved by developing and merging features in smaller increments behind a flag. By standardizing the process for feature development, experimentation, and code cleanup, the tool helps teams work more efficiently and effectively. Overall, the goal is to make it easier for market teams to manage and release features and improve results for the business’s deployment velocity.

Experimentation value
This innovative approach using the feature-flag library to experiment with features allows us to learn quickly and drive decision making with data.

When the library is fully enabled at McDonald’s, we can find best-performing user experiences faster, release high-performing features to a larger customer base quicker, and release features to a subset of users all while integrating with our internal data tools to gather customer insights throughout the customer journey.

Summary
We are always striving for the most scalable and efficient practices to deploy new features to global markets, while keeping our customers at the core of our decision making. This requires us to employ an innovative development mindset as we take on new opportunities. The integration of our feature-flag library allows us to be proactive in configuration management, retain our competitive edge, and dynamically engage with a feature flag management partner.

--

--