InfluxData sponsored this post.
One of the great things about SaaS applications is that users in the platform automatically have access to any available software updates. Yet, having a beta program requires a separate environment, creating a potential challenge for users and development teams.
In this context, having a tool where you can control features and flag certain users is important because sometimes features are too early or not relevant for all users. This is why, last year, we started using ConfigCat at InfluxData to accomplish that.
What Is ConfigCat?
ConfigCat is a hosted service for feature flag and configuration management. It enables you to decouple feature releases from code deployments. ConfigCat can be used to:
- Turn your features on/off using the ConfigCat Dashboard even after your code is deployed.
- Target user segments based on region, email, subscription or any other custom user attributes.
Last year, we started using ConfigCat in InfluxDB Cloud to share feature flags across the entire platform. Among other features, ConfigCat allows us to turn features on or off globally or to turn them on for specific users or groups of users. We can even turn features on for a percentage of users.
To enable easy integration with various applications, ConfigCat provides SDKs for a number of different languages. Unfortunately for our e-commerce team, Elixir wasn’t one of them and wasn’t on the immediate roadmap.
ConfigCat has an interesting approach to feature flagging. It provides a web application for creating and managing feature flags and targeting rules, but the actual work is done in the various SDKs. An SDK periodically downloads a JSON payload (a config) that describes the feature flags and targeting rules, and then uses that cached config to evaluate feature flags. This provides a number of benefits:
- Determine the value of a feature flag: No need to wait for an HTTP round trip
- No reliance on unreliable network communication: More effective communication for every feature flag evaluation
- Much less network traffic: An application only has to fetch an updated config as needed, or on a specific interval
- Sensitive user information stays local: Potentially sensitive user information is not sent across the wire; it stays local to your application
- Much less server infrastructure required: The ConfigCat service operates with less server infrastructure resulting in lower costs to customers
The downside is that it takes more work to build an SDK for a new language. ConfigCat’s SDKs are all open source, so we were able to review several of them to see what might be involved in writing a new one. Ultimately, we decided to move forward.
InfluxData, creator of the open source time series platform InfluxDB, empowers developers to build transformative monitoring, analytics and IoT applications quicker and to scale. The platform handles the massive volume of time-stamped data produced by IoT devices, apps, networks and containers.
Using ConfigCat at InfluxData
We started by building a ConfigCat SDK inside our application with plans to later extract it and open source it. This made it easier to iterate and ensure it was working for us. We were careful to keep the code as independent of the rest of our application as possible. Once we had it working, we started using it in production. Unfortunately, other priorities took precedence, and we weren’t able to take the time to extract the SDK to make it available to others.
As October approached, I was thinking about what I wanted to do for Hacktoberfest this year. I decided that I would get our ConfigCat SDK extracted, open sourced and published to Elixir’s hex.pm package registry.
Another company, Drover, was also interested in an Elixir SDK for ConfigCat and was willing to contribute. After some brief discussion, we decided to use our initial ConfigCat SDK as a starting point. With feedback from Lajos Szőke and the ConfigCat team, Drover’s Igor Escobar and I spent the next few weeks iterating on the project. We added features we hadn’t yet needed at InfluxData, refactored to make the SDK more consistent with the other language SDKs for ease of future maintenance, supported new settings and options that didn’t exist when we first wrote the client, and added the documentation that the Elixir community expects.
Afterward, Lajos had this to say about the effort:
“This was ConfigCat’s first completely community-driven SDK development. It was really awesome to see that after Igor [from Drover] initiated the discussion about developing the Elixir SDK, Randy [from InfluxData] jumped into the conversation with his ‘Can we help?’ Github issue. … Not just one but two of our customers wanted to help us with this SDK. The development phase was exceptional. … It was awesome to see how three totally different companies could join their forces for the great purpose.”
Once we were all happy with the result, we released the package to hex.pm, and it’s now available for anyone to use!
Featured image via Pixabay.