Releasing Features the Smart Way in .NET

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 85

  • @JeffryGonzalezHt
    @JeffryGonzalezHt Рік тому +35

    Good stuff - feature toggles are required for successful CI, for sure. We use percentage flags often for A/B testing, or slowly rolling out a new version of something we are monitoring, or "canary" features for a subset of users. So you'd have two routes for /weatherforecasts - one with the new version, one with the old, one would be disabled if the flag is true, the other disabled, etc. You can do cool stuff like that when you are decomposing a monolith using a strangler fig pattern for example. What I wish was easier, and you hinted at it here, was the ability to change the container for the services based on feature flags. Since you can't change the services collection after the app is built, you have to do corny stuff like the common service locator thing you showed.

  • @YungDeiza
    @YungDeiza Рік тому +1

    Feature flags are great for products that can be deployed for multiple clients who may want some features or enabled or disabled based on their requirements

  • @rsamuseu
    @rsamuseu Рік тому +1

    We use feature flags on our project. FF is great when you need to enable or disable functionality depending on requirements. For example, multicountry applications where for some of the country feature could be enabled and for others be disabled. Also, disabling some features helps to test functionality on the prod without any damage because it will be hidden from the user

  • @klocugh12
    @klocugh12 Рік тому +11

    Percentage is perfect for use case of trolling

  • @kasasatimothy8751
    @kasasatimothy8751 Рік тому +2

    Thank you so much, have been doing this manually... Will start using this library

  • @baranacikgoz
    @baranacikgoz Рік тому

    I was tought wait a sec, that could be done with simply adding a flag by yourself in appsettings, not via package. Then things got advanced ;) Great video

  • @rogeriobarretto
    @rogeriobarretto Рік тому +2

    Amazing stuff, wasn't aware of a such nice package until recently. Great video!

  • @PierreH1968
    @PierreH1968 Рік тому

    Thanks! That is a great way to do complex A-B testing! Thanks again for sharing!

  • @mahmoudalaskalany
    @mahmoudalaskalany Рік тому

    That is a very good explanation as usual my mentor , i think i will use a lot of your info in my next tech post ❤🎉

  • @Any1SL
    @Any1SL Рік тому

    We use features/toggles concepts to customize ui for different clients as well as enable all for premium clients

  • @sa-es-ir
    @sa-es-ir Рік тому +1

    Feature flags is very useful if you are using trunk base development (TBD)

  • @julienraillard3567
    @julienraillard3567 Рік тому +11

    Really interesting feature as always ! :)
    Would you like to show us the "AddSessionManager" too ? :D

  • @zebcode
    @zebcode 7 місяців тому

    Great stuff, I decided to opt to use an enum to define the constants rather than const strings for the feature names. Though it's still going to be suspectable to breakages should the name be refactored. Meh, it's on me in this project. It's something small I'm making for myself.

  • @inzyster
    @inzyster Рік тому

    I wasn't aware of this, I'll make sure everyone in my team is :)

  • @alirezanet
    @alirezanet Рік тому +7

    I think you didn't show the main reason behind this package which is making your web application extensible ... with external DLLs as a plugin. the things you showed in this video is achivable easily with IOptionMonitoring and IOptionSnapshot interfaces.
    I think this is just a plugin management library.

  • @ChallusMercer
    @ChallusMercer Рік тому

    Thank you for insights on this topic. Can you maybe elaborate further on this by explaining what is the best way of releasing some features for specific users. Maybe you could make a video on this topic.

  • @elpe21
    @elpe21 Рік тому

    For me, you're the Feature Manager ! :D

  • @ivankiselychnyk9176
    @ivankiselychnyk9176 Рік тому

    cool video, I used this package on previous project

  • @D4ngeresque
    @D4ngeresque Рік тому +1

    One of the main reasons I see for this is trunk based developement versus other branching strategies like gitflow etc... wondering what you're thoughts are on that.

    • @influento
      @influento Рік тому

      Exact my thoughts on this. If you use git flow then its barely possible you'd need features functionality. Ofc there are exceptions like when you want to use it for A/B testing or release some features only for specific group of users.
      All other use cases like ability to enable/disable features on prod sounds for me kinda wrong. If anybody disagree with me would be interesting to read your points

    • @CursedFire10
      @CursedFire10 9 місяців тому

      Actually, I have the same thought. It would encompass this feature more in my development team, considering another branching strategy. Currently, we use GitFlow, but the team has grown so much that our Staging environment has become a bottleneck.
      Therefore, I have also considered that using Feature Management at the version level might help manage a more transparent branching strategy between staging and production environments. For example, using the Trunk-Based Development (TBD) strategy, working with a single version Feature Flag and i would call it Version Flag, and if you want to work at a lower level, i will add a new level to use a feature flag.
      I see great advantages with this approach, as it would help our Staging and Production environments focus on a specific version... So, it is also understandable that the team must be disciplined in keeping the code updated by cleaning up the legacy code.

  • @CursedFire10
    @CursedFire10 9 місяців тому

    Hey Nick thanks for the video.
    Actually, I have the thought to use this feature more in my development team, considering another branching strategy. Currently, we use GitFlow, but the team has grown so much that our Staging environment has become a bottleneck.
    Therefore, I have also considered that using Feature Management at the version level might help manage a more transparent branching strategy between staging and production environments. For example, using the Trunk-Based Development (TBD) strategy, working with a single version Feature Flag and i would call it Version Flag, and if you want to work at a lower level, i will add a new level to use a feature flag.
    I see great advantages with this approach, as it would help our Staging and Production environments focus on a specific version... So, it is also understandable that the team must be disciplined in keeping the code updated by cleaning up the legacy code.
    What you do think over this tought?

  • @LindenMikus
    @LindenMikus Рік тому +1

    perhaps this could be a good way to release a new api version for endpoints. for the percentage setting, maybe a nice use case would be for a game of chance

  • @ryanzwe
    @ryanzwe Рік тому +4

    Feature flag the feature flags

  • @pavfrang
    @pavfrang Рік тому +2

    The PercentageFilter is clearly for prank purposes.

  • @fronix5060
    @fronix5060 День тому

    I use percentage features when I want to troll QA-testers. It's a lot of fun :)

  • @venussmodzhd1886
    @venussmodzhd1886 Рік тому +4

    Could i use my db instead on the configuration files with that nuget package?

    • @sergeivalko6514
      @sergeivalko6514 Рік тому +2

      yes you can, you have to implement IFeatureDefinitionProvider and then add it as Singleton, you can check their repo in custom feature provider section and learn more.

  • @RussianBananan
    @RussianBananan 6 місяців тому

    Nice overview, thanks! Is there any strategy on how to coordinate feature flags being enabled/disabled with frontend? I guess both BE and FE should manage feature flags at the same time in order not to be in the situation of enabled BE feature, which is not visible from FE, or, what is worse, disabled BE feature, getting called from FE.

  • @Arapa007
    @Arapa007 Рік тому

    Well done Sir. As always !!

  • @pilotboba
    @pilotboba Рік тому

    We use Jason Robert's feature toggles library.

  • @kRySt4LGaMeR
    @kRySt4LGaMeR Рік тому

    I've implemented something similar but using a Middleware, much more cleaner IMHO since I can explicitly inject services.

  • @Aline-Almeida
    @Aline-Almeida Рік тому +2

    I use this in my project. The main problem is when you get too many, code gets a nightmare! You need to keep it to a minimum. The other issue is that we have it in Azure feature management (one for each environment). How can we override those configs for local development?

    • @GlebWritesCode
      @GlebWritesCode Рік тому

      Create another environment called testing? Ideally separate one for each developer not to step on each other's toes

  • @RonyCuzco
    @RonyCuzco Рік тому

    excellent video! thanks for sharing!

  • @microtech2448
    @microtech2448 Рік тому

    Thanks for the video, how it can work with logged in user role. If the user is an admin show feature otherwise hide it?

  • @antonmartyniuk
    @antonmartyniuk Рік тому

    I have used FeatureGate attribute for NET 6 and had an interesting issue: my controller actions where not called, but Controller constructor was being called. I had to use some of my dependencies as Lazy so they creation was not triggered when feature was disabled

  • @IanWilkinson-SgtWilko
    @IanWilkinson-SgtWilko Рік тому

    Hi Nick,
    Do the filters on minimal APIs allow you to have two srtup for yhe same route and uae the feature flag to toggle between them?

  • @SmartLog356
    @SmartLog356 Рік тому

    Hello, Nick! Does dometrain give digital certificates after completing your courses?

  • @gayathrimahalingam95
    @gayathrimahalingam95 Рік тому

    Hi Nick, Is FeatureManagement supported in .Net framework 4.8? I am unable to create a DI through autofac for adding the package to my service. Any advice on this please?

  • @MatejKrhin
    @MatejKrhin Рік тому

    Would this be a viable solution for limiting features based on software license? Although the features would have to be retrieved from a license key or some other source.

  • @ArgeKumadan
    @ArgeKumadan Рік тому +11

    What if I want to enable a feature for a specific user role or even for a specific user. hmm, wait a second that's authorization 😄

    • @Arapa007
      @Arapa007 Рік тому +2

      I think the use case there would be advanced users selected to UAT features

    • @gpzim981
      @gpzim981 Рік тому +3

      No, that is not authorisation necessarily, yes you have to give permission to the user to use that feature, but the main thing here with feature flagging is that with FF you can enable a feature to some portion of your users, by country, by age, by email range etc etc.

    • @baranacikgoz
      @baranacikgoz Рік тому

      That's what we called role based authorization

  • @billy65bob
    @billy65bob Рік тому +1

    Is it perhaps possible to load the configuration based on some parameters the application can test at run time?
    I have a case for Feature management, but it's less about toggling them at runtime, and more restricting what's available based on whether the target database has been fully upgraded (i.e. all features are available), or not (unsupported features are disabled).
    If not, this library is cool, but it's not for me.
    EDIT I suppose I could conceivably do this using a custom FeatureFilter...

    • @andrewturrentine5303
      @andrewturrentine5303 Рік тому

      Yes, it is a little different than what was shown here but one way that I have used has been for asynchronous development. Different teams/services agree on a contract or condition and then it doesn't matter what order development happens, the consuming service can finish out their code first and have a feature flag that their dependency enables when ready.
      For your use case, as I understand it, the target database would be like that dependent service, so your DB upgrade process could enable a flag when complete that your application can then consume. Any production Feature Flag services - for example the cloud-based ones that Nick mentioned - will have both SDK and REST options for setting the feature flags rather than only reading them.

  • @ChrisWard74
    @ChrisWard74 5 місяців тому

    Currently using Launch Darkly. Is there a world where I would or should use this with Launch Darkly?

  • @chris-pee
    @chris-pee Рік тому +8

    So it's basically IOptionsMonitor with a different name, and some extra helpers for endpoints?

    • @alfflasymphonyx
      @alfflasymphonyx Рік тому +1

      That was exactly my thoughts! At least with the Options you can create your own Feature object that implements a time frame, a percentage....

    • @JohanBenschop
      @JohanBenschop Рік тому

      @@alfflasymphonyx Exept it's a little for than that. For example, we have a implementation of a `ISessionManager` that looks at the HTTP request headers to determine wether a feature should be on or not, this overrides whatever comes from configuration. And so you could have multiple of these `ISessionManager` polling multiple sources if you would so like. This can also include specific user/session information, ect.

    • @mahmoudalaskalany
      @mahmoudalaskalany Рік тому +3

      I think this is meant to separate between the responsibility of the configuration and feature management but yes all of this can be achieved by IOptionMonitor

  • @myhjrhfgnb
    @myhjrhfgnb Рік тому

    That is so cool. 😍

  • @ricardotondello
    @ricardotondello Рік тому +2

    Nice, thanks for sharing, We use this FeatureFlags for functionalities on our API's, however never used for endpoints, maybe would be nice to show how the Swagger looks like when you have the entire endpoint behind the featureFlag, it might be tricky if the flag is off and you use the swagger json to configure Azure API Management for example.

  • @kzryzstof
    @kzryzstof Рік тому

    We need the Rider’s New UI to be activated :P

  • @-kkkirito5658
    @-kkkirito5658 Рік тому

    What is the difference between feature flags and ISnapshotOptions?

  • @MarkCastle
    @MarkCastle Рік тому +1

    Could have sworn u already did this video

  • @2024-kanal
    @2024-kanal 4 місяці тому

    How to change config value in app deployed into kubernetes?

  • @GarethDoherty1985
    @GarethDoherty1985 Рік тому

    Could you use this for Blazor UI stuff. Show and hide things based on the logged in users subscription level?

    • @corE_dev
      @corE_dev Рік тому

      You should just use an component for this

  • @dotnetdevni
    @dotnetdevni Рік тому

    What about multi tennant

  • @efetisov
    @efetisov Рік тому

    Cool! Я хотел бы увидеть интеграцию этой библиотеки с MediatR. Это было бы круто!

  • @Don-ii4vm
    @Don-ii4vm Рік тому +1

    Excellent video. Thanks Nick.
    Could you do a video on Custom fields?
    Say a small contacts table where one company wants to list whether the contact is a smoker, gender, availability, etc and another company wants to log passport information, Dob, etc?

  • @metaltyphoon
    @metaltyphoon Рік тому

    A good usage of the percentage flags would be to deprecate an endpoint over time by making it fail gradually over a period.

  • @dotnetdevni
    @dotnetdevni Рік тому

    I just dont get this flag is just 1 or 0

  • @JackBauerDev
    @JackBauerDev Рік тому +1

    Funny how the minimal API at the end was way more verbose than normal controllers. Still not using minimal

  • @TechAndMath
    @TechAndMath Рік тому +3

    This function is almost useless or at least very bad practice in fair amount business scenarios.
    1. You should not allow anyone just go to production portal and configure something which dramatically change a production without easy to investigate trace.
    2. You should not listen to so called on fly appsetting change, as if you do that, in quite a lot of cases, your site/product will need to restart. Then what will happen to the users connected to your site/product? Suddenly they will lost connection.
    3. If you put this in appsetting, and your site runs multiple instances, you will need to manually go update all these sites. BAD
    4. If you put this in some central place and your site listen to the change, suddenly all the sites/products listen to this will all restart and your sites are all down. Evil.
    There may be some usages for this, but in the industry I am in (finance and data), I can't see any suitable scenarios for my work.
    If you want to enable some feature, do a deployment or use some other technique, but not this feature management

    • @JohanBenschop
      @JohanBenschop Рік тому +3

      The use of the appsettings is usefull most for development. In production, the use of something like Azure App Configuration let you manage this with auditing and security in mind. And it doesn't restart the app, but configures multiple path in the app.

    • @z0nx
      @z0nx Рік тому

      We sometimes use this to toggle some feature for test/acc/prod, but do so with a pullrequest and an actual redeploy. I always wondered why we use this package when its basically just the options pattern without using the on-the-fly changes. I guess because it's called FeatureManagement?
      Agreed with most of your points, but I think the way @JeffryGonzalezHt seems to use it sounds like a decent way to about it as well though.

    • @gunnarliljas8459
      @gunnarliljas8459 Рік тому +5

      1. Add tracing
      2. The idea is that it should provide runtime toggles. If it doesn't, well, don't use it.
      3. Put it somewhere else
      4. See 2

    • @TechAndMath
      @TechAndMath Рік тому

      ​@@JohanBenschop Another team demonstrated this App Configuration service together with this feature function some months ago and it was rejected by the company I work in.
      The problem with App config Service is that unlike keyvault, the value needs to be readed in periodically. Then the DI will also need to handle the change.
      It didn't provide enough value or at least evidence to support paying for this App Configuration Service.

    • @jankowalski9663
      @jankowalski9663 Рік тому +1

      He addressed almost every point in the video.

  • @ЕгорФедоренко-с2щ

    About TimePeriodFilter. Am I right it resets every time I redeploy the application? I can't imagine a use case for that, I probably do not want the timer to reset on every deploy.