One of the simplest ways to do a gradual frontend rollout does not need a feature flag service at all. A cookie and a random number are enough. Here is the idea...
When a user first hits your application, generate a random integer between 1 and 100 and store it in a cookie. That number stays fixed for that user across sessions, since the cookie persists.
Now the rollout is just a comparison. Keep a rollout percentage on the server, say 30. If the user's cookie value is less than or equal to 30, they get the new version. Everyone else stays on the old version.
Want to increase the rollout? Just change 30 to 60 in the backend where you are checking. The users in buckets 31 to 60 now get the new version, while everyone who was already on it stays there.
Rolling back works the same way. Drop the percentage back down, and anyone whose bucket is now above the threshold goes back to the old version on their next request.
The random number is essentially putting each user into one of 100 buckets, and the rollout percentage is simply a threshold over those buckets.
No feature flag service, no explicit session store. Just a simple cookie + a random number + one comparison. Sometimes, that is all you need :)
Hope this helps.
Madhuri Dixit’s home. One of India’s greatest superstars living in a slightly bigger matchbox. Yesteryear stars did well with the Bungalows. Rekha. Shahrukh. Amitabh.
There was a time when I'd have to reach office at 7am and leave at 2am for me to be the first to reach and last to leave.
This is a co-working space in Bangalore at 6:30pm. Shame.
@striver_79@pjparties My understanding is that people are afraid of the 'laid-off' remark in their relieving letter and this makes it look like the employee resigned.