GrowthBook alternative: files, not a server
dif is an open-source GrowthBook alternative that keeps every flag and experiment as a Markdown file in your repo, with no separate app or database to run. GrowthBook is a strong, established open-source tool: you self-host its app and its database, or pay for GrowthBook Cloud, and either way the flag lives in that system, not in your repo.
Both are open source. dif runs from your repo with nothing else to host. GrowthBook is an app: a UI, an API, and a database your code calls over the network, with a stats engine that queries your data warehouse for results. The split is where the flag actually lives, a row in GrowthBook’s database or a file your CI validates, and that split decides most of what follows.
Key Takeaways
- dif keeps flags and experiments as Markdown files in your repo. GrowthBook runs as a separate app with its own database, self-hosted or on GrowthBook Cloud.
- Both are MIT licensed and open source. GrowthBook is free to self-host; dif has nothing separate to host, so the CLI and SDK are free too.
- GrowthBook is warehouse-native, querying BigQuery, Snowflake, or Databricks, with a mature stats engine (Bayesian and frequentist analysis, CUPED, sequential testing, bandits) and SDKs in 20-plus languages. That depth is real.
- dif’s runtime SDK is about 5 kB with zero dependencies and makes no network call to assign a variant.
dif buildwrites acontext.jsona coding agent reads, which GrowthBook’s app cannot hand an agent.- Pricing splits on the model: GrowthBook Cloud is per seat ($40/seat on Pro, free up to three users). dif Cloud is per event ($50/month for 1 million events, unlimited seats).
Why teams look for a GrowthBook alternative
GrowthBook works, and it is the best-known open-source experimentation tool for a reason. Teams go looking for an alternative anyway, usually for one of three reasons.
Running the app. Self-hosted GrowthBook means operating its UI, its API, and its database yourself, or paying for GrowthBook Cloud instead. Either way, there’s a service in the stack between your code and the flag’s value.
Drift. The flag is a row GrowthBook’s app serves over the network. The code that gates on it lives in your repo. The two are not the same system, so a flag can outlive the feature it gated because deleting it means opening the app, not opening a pull request.
The warehouse prerequisite. GrowthBook’s stats engine earns its keep by querying your data warehouse directly. That’s a real strength if your metrics already live in BigQuery, Snowflake, or Databricks. If they don’t, standing up that pipeline is a project before you run your first test.
What GrowthBook does well
GrowthBook earns its reputation. It queries the warehouse you already have, BigQuery, Snowflake, or Databricks, instead of asking you to pipe events into yet another analytics store. If your metrics already live there, you skip a whole instrumentation step most other tools make you build.
The stats engine goes deep: Bayesian and frequentist analysis, CUPED variance reduction, sequential testing, multi-armed bandits. Few open-source tools bother with that much rigor. The SDK list runs past 20 languages, so a polyglot backend is covered before you write a line of integration code.
None of that is a knock on dif. It just means a different job gets done well. If reading your warehouse directly and running serious statistics on it is the point, GrowthBook is built for that job. dif’s SDK is JavaScript and TypeScript, and it has no opinion about your warehouse at all.
dif as the alternative: files, not a server
dif starts from a different opinion: a flag or an experiment is part of your codebase, so it should live in your repo, not in an app with its own database. Each one is a single Markdown file next to the code it changes.
---
id: checkout-cta-copy
status: active
owner: sam@acme.com
surface: checkout
hypothesis: >
A benefit-led CTA lifts completed checkouts over the control.
variants:
- id: control
weight: 50
- id: get_it_today
weight: 50
metrics:
primary: completed_checkout
guardrails:
- refund_rate
---
You review that file in a pull request. Its history is the git history, and dif validate runs in CI, so a broken flag fails the build the same way a broken test does. A flag and an experiment are the same file format, so an experiment that wins becomes a flag you ramp by editing the weights, with no application code to touch. Because the flag is a file, a coding agent can read it: dif build writes a context.json of every active flag and each surface’s latest learning, which an app’s UI cannot hand to an agent. The runtime SDK is about 5 kB, makes no network call to assign a variant, and ships adapters for React and Svelte.
That model has a real cost. dif’s SDK is JavaScript and TypeScript only, and it does not read your warehouse. Analysis runs through dif Cloud events or handlers you write yourself, not a query against Snowflake.
dif vs GrowthBook, side by side
| Dimension | dif | GrowthBook |
|---|---|---|
| Where flags and experiments live | Markdown files in your repo | The GrowthBook app and its database |
| Server to run | None | Self-hosted app and database, or GrowthBook Cloud |
| License | Open source (MIT) | Open source (MIT) |
| Change a flag | Edit the file, open a PR, merge, deploy | Toggle in the app; takes effect without a deploy |
| Experiment analysis | dif Cloud events, or your own handlers | Warehouse-native: queries BigQuery, Snowflake, Databricks |
| Stats engine | Primary metric plus guardrails | Bayesian and frequentist, CUPED, sequential testing, bandits |
| SDK languages | JavaScript and TypeScript (React, Svelte) | 20-plus languages |
| Runtime SDK | ~5 kB, zero dependencies, no network call to assign | SDK plus a payload fetched from the API or CDN |
| Agent-readable state | Yes (context.json) | No |
| Hosted pricing | $50/mo for 1M events, unlimited seats | Free up to 3 users, then $40/seat/mo on Pro |
Count the rows honestly and GrowthBook takes four: the warehouse read, the stats depth, the SDK count, and the instant toggle from its UI. dif takes the rest, because its model answers a different question: where does the flag live, and who reviews a change to it.
Pricing: event-based vs seat-based
Both tools are free at the open-source layer. GrowthBook is free to self-host, its app and its database. dif has nothing separate to host, so the CLI and SDK are free and dif Cloud is optional. The hosted plans price on different axes, and the gap compounds with headcount.
GrowthBook Cloud is seat-based: free for up to three users, then $40 per seat per month on Pro. You pay for the people running experiments and managing flags.
dif Cloud is event-based: $50 a month for 1 million events, then $0.02 per 1,000, with unlimited seats. You pay for traffic, not headcount.
A three-person team running high-traffic experiments pays less on GrowthBook’s seat model. A fifty-person team running modest traffic pays less on dif’s event model. Neither is universally cheaper, but both undercut per-seat-plus-usage incumbents like LaunchDarkly.
Who should switch, and who should stay on GrowthBook
Stay on GrowthBook if any of these are true:
- Your metrics already live in a data warehouse and you want the stats engine to query it directly, with Bayesian or frequentist analysis, CUPED, or bandits.
- You need SDK coverage across many backend languages today. dif’s SDK is JavaScript and TypeScript, with React and Svelte adapters.
- A non-engineering teammate manages experiments from a UI, and that UI is part of the workflow you want to keep.
Switch to dif if any of these are true:
- You want flags and experiments reviewed in a pull request next to the code they gate, with no separate app to run or patch.
- Your stack is JavaScript or TypeScript and you’d rather not operate a service to hold a few dozen flag rows.
- A coding agent works in your repo.
dif buildwritescontext.json, which Claude Code or Cursor reads on session start, something GrowthBook’s app cannot give an agent.
Moving from GrowthBook to dif
There’s no one-click import, because the two store flags in different places. Moving a flag means recreating it as a .md file with the same variants and weights, gating the code path with a dif("flag-id") call, and running dif validate.
A GrowthBook call in TypeScript:
import { GrowthBook } from "@growthbook/growthbook";
const gb = new GrowthBook();
if (gb.isOn("new-checkout")) {
return <NewCheckout />;
}
return <LegacyCheckout />;
The dif equivalent, once the flag exists as a file and dif build has compiled it:
import "./dif/generated/client";
import { dif } from "@dif.sh/sdk";
if (dif("new-checkout") === "on") {
return <NewCheckout />;
}
return <LegacyCheckout />;
Because the flag is now a file, that migration is a normal pull request, reviewed like any other change. Port one active flag at a time rather than the whole back catalog, and run dif validate on each before merging.
Try dif as your GrowthBook alternative
Install the CLI and scaffold a project. No account or API key required.
npm install -g @dif.sh/cli
dif init
dif init writes a dif/ directory, a generated TypeScript client, and the flag files. From there, dif new drafts a flag or experiment, dif validate checks it in CI, and dif build compiles it. The feature flags page covers the flag side, and the docs cover install.
For the full feature-by-feature breakdown, see dif vs GrowthBook.
FAQ
Is dif a good GrowthBook alternative? Yes, for teams that want flags and experiments reviewed in a pull request rather than managed in a separate app. Both are open source. GrowthBook self-hosts an app and a database, or runs on GrowthBook Cloud; dif has nothing separate to host, since the CLI and SDK run in your repo and dif Cloud is an optional hosted layer.
Does dif read my data warehouse like GrowthBook? No. GrowthBook is warehouse-native and queries BigQuery, Snowflake, or Databricks directly for experiment results. dif analyzes through dif Cloud events or custom handlers you own. If querying your warehouse is central to how you read experiments, that’s a point for GrowthBook.
Is GrowthBook or dif better for A/B testing? GrowthBook has the deeper stats engine, with Bayesian and frequentist analysis, CUPED, and bandits, plus direct warehouse access. dif runs the experiment as a file in your repo and analyzes through dif Cloud or your own handlers. Pick GrowthBook for stats depth, dif for experiments that live in git with a coding agent reading the state.
How does pricing compare? GrowthBook is free to self-host, then GrowthBook Cloud is per seat: free up to three users, $40/seat/month on Pro. dif has nothing to self-host, so the CLI and SDK are free, and dif Cloud is per event: $50/month for 1 million events, unlimited seats. Small teams with heavy traffic often pay less on GrowthBook’s model; larger teams with modest traffic often pay less on dif’s.
What’s the tradeoff with dif? Rolling back a flag means editing a number to 0 and merging, a commit and a deploy, not an instant toggle in an app. If your build takes ten minutes, your worst-case kill is ten minutes. For a flag that needs a sub-second kill switch, that’s a real cost to weigh.
Do I need a database to run dif? No. The CLI and SDK run entirely from your repo, with no database and no admin app. ls dif/*/active/ is the state of everything in flight.