Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
501 views
in Technique[技术] by (71.8m points)

version control - Feature Toggles vs Feature Branches

What are "Feature Toggles" and "Feature Branches" and what's the difference between them?

What are the pros and cons? Why is one better than the other?

I found some articles on Google regarding this, and I tend to be in the "Feature Toggles" camp, but I'm not convinced that "Feature Toggles" is the better choice in all the cases.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Feature toggles are methodology used in a Continuous Integration/Continuous Delivery (CI/CD) chain (Agile/Kanban project methodology). Basically, you send new features to production in a disabled state, then in an admin console turn the feature on (or off if you discover it's broken).

Feature branches can be part of a release methodology and integrated into a continuous integration chain. You can develop in a feature branch, deploy the branch to DEV/QA, get certification, merge the feature branch to trunk, then push the trunk to SIT/UAT/PROD environments.

There are pros and cons associated with this approach. Feature toggling requires very strict discipline as broken/dark code is making it to production. This is great for startups and shops where management knows how to pull this off and has system automation tools in place (Chef/Puppet/cfengine, etc.) Google, Facebook, LinkedIn, WordPress all deploy to production environments using feature toggling and system automation.

There are some prerequisite "techs" to do feature toggling properly: Continuous Delivery/Deployment, Continuous Integration, Automated Unit Testing, Automated Integration Testing, Automated Stress/Performance Testing, System Automation. If you don't have these in place, consider a simpler release strategy (e.g. feature branching.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...