How Backend SDKs Work
Backend SDK keys (qf_sk_…)
Backend SDKs authenticate with a secret SDK key — sk for secret. It must stay server-side; the rule data and the entire config payload travel with this key, so anyone who has it can read your raw targeting rules.
# .env — server-only, never expose to the browser
QUONFIG_BACKEND_SDK_KEY=qf_sk_test_0654_0b5d67xxxxxxxxxx
Backend keys are paired with frontend keys (qf_pk_…) which are safe for the browser — see Frontend SDKs. Use backend keys in Node, Go, Ruby, Python, Java, and other server runtimes.
Generate backend keys from Settings → SDK Keys in the Quonfig dashboard.
SDK Architecture
The Quonfig server-side SDKs are all built with the following 3 goals in mind:
- Very fast lookups that do not require any remote calls.
- Being highly resilient in the case of outages
- Near instant updates when changes are made
The architecture to do this looks like this:
Your code will instantiate a singleton of a Quonfig Client. This client starts will fetch the latest configuration, trying multiple sources in case of errors. Once it gets a connection it will unlock and be available for your code.
The client will also start a streaming connection to the APIs to pull down new changes.
The delivery service is split across two hosts: short-lived HTTP fetches go to
primary.quonfig.com and the long-lived SSE stream goes to
stream.primary.quonfig.com. The SDK derives the stream host from the
configured API URL (by prepending stream.) so you only configure one
apiUrls list and routing is automatic.
Additionally, the SDK will poll for updates as a resiliency measure.
Note that the evaluation is always happening in-process in your application. Feature flags and config are stored in process so are lightning fast (no API calls when you access them).
Implementation
When your client boots, it creates a local thread safe hashmap which will hold the config. The general purpose Quonfig config system will then push & pull changes down to your clients. The expected latency is < 100 ms.
Feature flags are built on top of the Quonfig config store so all reliability notes are applicable for Feature Flags as well.