Lesson 3: Work with Clients

What is a client?

A feature flag is not useful for anyone unless it's consumed. The consumer of this feature flag is not the end user of your product but rather a part of your application. We call this consumer a client. Most feature flagging systems support clients of both backend and frontend types, and most provide SDKs to easily integrate.

Best practices

There is no benefit to having multiple systems share a single client. Instead, treat every integration as its own client. This allows for a flexible and future proof approach where frontend clients (using the static paradigm) are not overwhelmed with all the flag data that is only relevant to backend clients.

In other words, by only letting one app access the flags that are relevant to it, you can reduce the overhead of having many flags in your systems.

Example: Manage latency with multiple clients

Client granularity and security

It's good to have one client per app (backend service or frontend application). With this granularity, you can control the access of individual modules. For instance, you can revoke access to one backend service without stopping all of the others. A single client per app also helps you control what information is exposed to the user. Even if you don't expose all flags directly to the user, any information that reaches a frontend app can be considered exposed. For instance, if you have a flag intended for a backend service called 'enable super secret new feature X' and you use the same client for your frontend, that flag is still fetched and could be introspected by someone snooping around with a browser debugger.