DEV Community

Cover image for Feature Toggle
Israel-Lopes
Israel-Lopes

Posted on • Edited on

Feature Toggle

What is feature toggle?

Feature toggles is a design pattern where you place switches in the middle of your code, which will allow you to turn parts of your code on and off based on several things, one of which is functionality.

Feature flags

It's the switches, the toggles that you put inside your code.

What are the advantages?

The first advantage is that you can effectively work with trunk based. You won't have several branchs to merge and go up to production, so you'll have a single branch where everyone will commit, but the code that that go up will be off. That can go up to homologation, production, and staying that way off.

First advantage is that you don't suffer from merges, avoiding those problems (it worked and after the merge it doesn't work but).

  • Another thing is that if there is a problem in the code in production, you can turn off the piece of code.
  • For work environments that breathe ecommerce or similar, it is a great option. Because you can activate and deactivate advertisements, temporary promotions, etc., all with just one false flag.

And this is a great advantage of the concept.

Texto alternativo da imagem)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay