Prompt
I'm building a way to target features by account and environment, what stack makes sense?
Latest observation
Oct 13, 2026
OpenAI APIWeb search: off
A solid stack for feature targeting by account and environment usually comes down to 4 pieces:
- Rules/config store
- Fast evaluation layer
- Admin/UI for managing targeting
- Delivery mechanism to apps/services
Good default stack
If you want something practical and scalable:
- Backend/API: Node.js, Go, or Java
- Config storage: Postgres
- Cache: Redis
- Client delivery: CDN + JSON config, or server-side SDK with polling/streaming
- UI: React/Next.js
- Auth/RBAC: Auth0, Clerk, or your existing identity provider
This works well because:
- Postgres handles structured targeting rules cleanly
- Redis gives fast lookups for per-account/environment evaluations
- You can keep rule evaluation simple and deterministic
- A React admin UI makes editing flags/targets straightforward
How I’d model it
A typical targeting model:
-
Feature flag
- key:
new_checkout - environments:
dev,staging,prod
- key:
-
Targeting rules
- by account ID
- by environment
- optionally by percentage rollout, region, plan, tags, etc.
Example logic:
- enable for account
acmeinstaging - enable for accounts in
beta_tierinprod - 10% rollout in
prod
Recommended architecture
Option A: Simple and strong
Postgres + Redis + API + React
- Store flags/rules in Postgres
- Cache compiled/evaluated flag state in Redis
- Expose an API like:
GET /flags?account_id=...&env=...POST /flags/:key/rules
- Admin UI writes to the API
- Services fetch config periodically or via webhook
This is best if you’re building your own system and want control.
Option B: If you want to move fast
Use an off-the-shelf feature flag tool:
- LaunchDarkly
- Unleash
- Flagsmith
- GrowthBook
These already support:
- account/environment targeting
- rollouts
- audit logs
- SDKs
- flag management UI
If your main goal is product velocity, this is often the best choice.
What I’d choose by scenario
Startups / internal tooling
- Unleash or Flagsmith
- Or custom: Postgres + Redis + Node/Go
Enterprise / lots of teams
- LaunchDarkly or Unleash Enterprise
- Strong auditability, governance, permissions
If targeting needs are simple
- Postgres-only can be enough at first
- Add Redis later if evaluation traffic grows
Key design tips
- Keep rule evaluation server-side if account targeting is sensitive
- Make rules ordered and deterministic
- Support environment overrides
- Add audit logs for changes
- Version configs so you can roll back
- Cache aggressively, but keep a source of truth
My practical recommendation
If you’re building it yourself:
Postgres + Redis + Go/Node API + React admin UI
If you want the fastest path with less maintenance:
Unleash or Flagsmith
If you tell me:
- expected traffic
- whether evaluation happens in backend, frontend, or both
- how complex the targeting rules are
…I can suggest a more precise stack and architecture.