Skip to content

Research: Evaluate Unleash as GrowthBook replacement #368

@wax911

Description

@wax911

Investigation: Unleash vs GrowthBook Evaluation

Overview

Research findings on migrating from GrowthBook to Unleash as the feature flagging platform for on-the-edge and Local-Stack.

Current State

  • SDK: @growthbook/growthbook@^1.2.2 (JSR, Deno-compatible)
  • Integration: ExperimentService (src/experiment/) with per-request middleware
  • Features: 9 boolean toggles + 2 value parameters (platform-source array, episode-align-title-sim numeric)
  • Middleware: GrowthBookMiddleware initializes features per request

Key Findings

Unleash Architecture

  • Open-source: Feature-complete, no payment-gated features
  • Database: PostgreSQL-backed (required, no in-memory mode)
  • APIs: Admin API, Client API (backend SDKs), Frontend API (edge-optimized)
  • Metrics: Polling-based (SDKs report usage metrics periodically)

Feature Parity Analysis

Feature GrowthBook Unleash Notes
Boolean flags Core functionality solid in both
Typed values GrowthBook: JSON primitives; Unleash: variants + payloads
A/B Testing ✅ Built-in ⚠️ Via Variants GrowthBook native; Unleash variant system (less integrated)
Activation Strategies ⚠️ Limited ✅ Rich Unleash: userId, % rollout, custom context
Analytics ✅ Native ⚠️ Basic metrics GrowthBook: built-in results; Unleash: usage tracking only
Deno Support ✅ Tier-1 NO OFFICIAL SDK CRITICAL GAP
Payment Gating ⚠️ Some features ✅ None Unleash fully open-source
Self-hosted Ease ✅ Lightweight (2GB) ✅ Standard (PostgreSQL required) Both viable

Critical Blocker: Deno SDK

  • Status: ❌ No official Deno SDK available
  • Workaround: unleash-js-sdk via npm compatibility layer
  • Risk: Untested in Deno edge environment; requires polyfills
  • Decision: REQUIRES SPIKE VALIDATION BEFORE PROCEEDING

A/B Testing Consideration

  • GrowthBook: Native experiments with automatic result tracking
  • Unleash: Variant system (requires external analytics wiring)
  • Impact: Current use (simple toggles) → ✅ fine; future AB testing → ⚠️ needs planning

Recommended Next Steps

Plan 1: Deno SDK Spike

Objective: Validate Unleash JS SDK compatibility with Deno/Danet runtime

Deliverables:

  • Test harness: on-the-edge/tests/spike/unleash-deno.test.ts
  • Decision document: on-the-edge/docs/unleash-decision.md
  • Go/no-go recommendation with findings

Scope:

  • Attempt import of unleash-js-sdk via Deno npm compatibility
  • Create minimal test harness (isolated from Danet)
  • Verify basic operations: initialization, flag evaluation, context updates
  • Test storage polyfills (localStorage replacement for Deno)
  • Document findings and blockers

Success Criteria:

  • Test passes OR clear, specific blockers documented
  • Runtime errors (if any) are understood
  • Go/no-go decision made

Plan 2: Parallel Operation Adapter

Objective: Support both GrowthBook and Unleash SDKs simultaneously via adapter pattern

Scope:

  • ExperimentAdapter interface (src/experiment/adapters/experiment.adapter.ts)
  • GrowthBookAdapter wrapping existing logic
  • UnleashAdapter integrating new SDK
  • SDK selection via EXPERIMENT_PROVIDER env var
  • Full unit test coverage

Deliverables:

  • Adapter interface & implementations
  • Updated ExperimentService (forwarding to adapter)
  • Unit tests for both adapters
  • Updated .env.example
  • Migration documentation (docs/experiment-migration.md)

Benefits:

  • Zero-downtime migration capability
  • Per-environment SDK selection
  • Validation period before full cutover
  • Easy rollback if issues discovered

Timing: Post-spike validation (depends on Plan 1 success)

Deployment Context

Local-Stack infrastructure already provides:

  • PostgreSQL (in infrastructure.yml) - required by Unleash
  • Traefik routing (for admin UI + API)
  • OTEL collectors (for observability)
  • Redis (for future cache layer)

See local-stack infrastructure issue for full deployment plan.

Related Issues

Open Questions

  1. ✅ Deno SDK compatibility? → Requires spike
  2. ✅ A/B testing expansion planned? → Affects migration strategy
  3. ✅ Metrics/analytics integration? → May need external tooling with Unleash

Status

  • Research: ✅ Complete
  • Spike: ⏳ Pending (awaiting approval to proceed)
  • Adapter: ⏳ Blocked on spike results
  • Migration: ⏳ Blocked on adapter implementation

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions