← Blog

dif vs GrowthBook: flags in your repo, or in an app

dif and GrowthBook are both open-source tools for feature flags and A/B testing, and the difference is where the flags and experiments live. dif keeps each one as a Markdown file in your repo, reviewed in a pull request. GrowthBook runs them in a separate app with its own database, and reads results from your data warehouse.

Both are MIT licensed and self-hostable, so this is not the usual open-versus-closed comparison. It is a difference in model. GrowthBook is an app you run, with a strong stats engine that queries the warehouse where your metrics already live. dif is a CLI and a file format, with the repo as the source of truth and nothing hosted in between. This post lays out what each does well and who each fits.

Key Takeaways

  • dif and GrowthBook are both open source (MIT) and self-hostable. The real difference is the model, not the license.
  • dif keeps flags and experiments as Markdown files in your repo, reviewed in a PR. GrowthBook manages them in its own app and database.
  • GrowthBook is warehouse-native: it reads results from BigQuery, Snowflake, or Databricks, with a mature stats engine and more than 20 SDKs. That is its real strength.
  • dif is git-native and agent-native: one file format, a ~5 kB SDK, and a context.json a coding agent reads. Its SDK is JavaScript and TypeScript only.
  • Pricing splits on the model: GrowthBook Cloud is per-seat; dif Cloud is per-event with unlimited seats. Both are free to self-host.

What GrowthBook does well

GrowthBook is the best-known open-source experimentation tool, and its strengths are real.

It is warehouse-native. Instead of piping events into a separate analytics store, GrowthBook queries the data warehouse you already have, BigQuery, Snowflake, or Databricks, so your experiment metrics come from the same numbers your analysts trust. For a data-mature team, that removes a whole instrumentation step.

Its stats engine is mature. GrowthBook does Bayesian and frequentist analysis, CUPED variance reduction, sequential testing, and multi-armed bandits, the kind of depth that took the incumbents years to build. It ships more than 20 SDKs, so a polyglot backend is covered.

If experiment analysis is the center of your work and your metrics already live in a warehouse, GrowthBook is built for exactly that. dif does not match its stats engine or its language coverage, and it does not try to.

Where dif is different

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 a separate app. 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. There is no separate app to run and no database to reconcile against the code. A flag and an experiment are the same format, so an experiment that wins becomes a flag you ramp by editing the weights. And because the flags are files, a coding agent can read them: dif build writes a context.json of every active flag and each surface’s latest learning, which a dashboard cannot hand an agent. The runtime SDK is about 5 kB and makes no network call to assign a variant. That is the same model behind the open-source LaunchDarkly alternative and feature flags in git.

That model has a cost. dif’s SDK is JavaScript and TypeScript only, and it does not read your warehouse. Analysis runs through dif Cloud events or your own handlers, not a query against Snowflake.

dif vs GrowthBook, side by side

DimensiondifGrowthBook
Where flags and experiments liveMarkdown files in your repoThe GrowthBook app and its database
LicenseOpen source (MIT)Open source (MIT)
Source of truthThe repo, reviewed in pull requestsThe app UI and API
Experiment analysisdif Cloud events, or your own handlersWarehouse-native: reads BigQuery, Snowflake, Databricks
Stats enginePrimary metric plus guardrailsBayesian and frequentist, CUPED, sequential, bandits
SDK languagesJavaScript and TypeScript (React, Svelte)More than 20, across most languages
Runtime SDK~5 kB, zero dependencies, no network call to assignSDK plus a payload fetched from the API or CDN
Agent-readable stateYes (context.json)No
Separate app or database to runNoYes (self-host, or Cloud)
Change a flagCommit and deployToggle in the app
Hosted pricing$50/mo for 1M events, unlimited seatsPer seat ($40/seat Pro, free up to 3 users)

Four of those rows go to GrowthBook: the warehouse-native analysis, the stats engine, the breadth of SDKs, and the instant in-app toggle. dif wins where its model does: the flags are in the repo, there is no app to run, the state is agent-readable, and large teams are not billed per seat.

Pricing

Both tools are free to self-host, because both are open source. The hosted plans price on different axes, and the gap matters at scale.

GrowthBook Cloud is seat-based: free for up to three users, then $40 per seat per month on Pro. You pay for the people who run experiments and manage flags.

dif Cloud is event-based: $50 per month for 1 million events, then $0.02 per 1,000, with unlimited seats. You pay for traffic, not headcount. The dif Cloud pricing page has the detail.

Which is cheaper depends on your shape. A three-person team running high-traffic experiments pays less on seats; a fifty-person team running modest traffic pays less on events. Neither model is universally cheaper, and both undercut per-seat-plus-usage incumbents like LaunchDarkly.

Who should choose which

Choose GrowthBook if experiment analysis is the priority, your metrics already live in a warehouse you want to query directly, you need SDKs in many languages, or non-engineers manage experiments in a UI. Its stats depth and warehouse-native model are the reason to pick it.

Choose dif if you want flags and experiments in the repo, reviewed in pull requests, with no separate app to run, and your stack is JavaScript or TypeScript. It fits engineering-led teams that live in git, and teams giving a coding agent a readable view of what is gated and what has already been tried.

Moving from GrowthBook to dif

There is 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. Because the flag is now a file, that migration is a normal pull request, reviewed like any other change. Start with a handful of active flags rather than the whole back catalog.

Try dif

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 typed 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 shows the workflow, experiments as files covers the A/B side, and the docs cover install.

FAQ

Is dif a GrowthBook alternative? Yes, for teams that want flags and experiments in the repo rather than in a separate app. Both are open source and self-hostable. dif keeps each flag as a Markdown file reviewed in a pull request; GrowthBook manages flags and experiments in its own app and reads results from your data warehouse.

Is GrowthBook or dif better for A/B testing? GrowthBook has the deeper stats engine and reads directly from your warehouse, so it is the stronger choice when analysis is the priority. dif runs the experiment as a file in your repo and analyzes through dif Cloud or your own handlers. Pick GrowthBook for warehouse-native analysis depth, dif for experiments that live in git.

Are dif and GrowthBook both open source? Yes. Both are MIT licensed and self-hostable. GrowthBook runs as an app with its own database; dif runs from your repo with nothing hosted in the core. The difference is the model, not the license.

Does dif read my data warehouse like GrowthBook? No. GrowthBook is warehouse-native and queries BigQuery, Snowflake, or Databricks directly. dif analyzes through dif Cloud events or custom handlers you own. If querying your warehouse is central to how you analyze experiments, that is a point for GrowthBook.

How does pricing compare? Both are free to self-host. GrowthBook Cloud is per-seat ($40/seat per month on Pro, free up to three users). dif Cloud is per-event ($50/month for 1 million events, unlimited seats). Per-seat is cheaper for small teams with high traffic; per-event is cheaper for large teams with modest traffic.