Firebase Cloud Messaging with Remote Config to Update Mission Critical Configs

Sumit Das
2 min readSep 10, 2017

--

Last week someone from our organisation ended up changing configurations on Firebase Remote Config. That exposed features to hundreds of thousands of our android users, unintended of course. The fix seemed quite simple, all we needed was to revert the changes and publish the configs again. However, we soon realised that the corrected configs won’t get to the apps until cache expires.

You might also find yourself dealing with a similar problem, sooner or later. We needed something that’ll allow us to instantly force the apps to refresh the remote configs on a cache based system.

That’s when FCM Data Messages came into the picture. With FCM you can send a variety of commands to your application, one of which can be a command to force update Remote Config. All seemed good until, I came across this article which talks about server side throttling of remote config calls which essentially means that if millions of your application instances attempt to fetch the remote config with cache expiry set as 0, Firebase will throttle the calls.

A better approach turned out to be setting a flag in the application when update Remote Config command was received and on application start configs could be updated based on the flag. This way not all your application instances would try to update the config all at the same time and you prevent your Firebase app from being throttled.

Firebase not documenting the limit on server side throttling prevented us from implementing a better strategy to tackle the force update, but if you come up with something better please let me know in the comments.

You can find the demo project here.

--

--