Comparatifs

datagen vs model2data: Synthetic Test Data From a DSL or Straight From Your Schema

You need realistic fake data without touching production. datagen compiles a data-model DSL into fast native code; model2data reads your database schema and ships a ready-to-run dbt project.

Every data and engineering team eventually needs a pile of realistic fake data: to test a pipeline, demo a product, or onboard a developer — all without copying production data and its privacy risks into yet another environment. Writing fake data by hand falls apart immediately, because real databases have relationships: orders belong to customers, who belong to regions, and random rows break all of it. datagen and model2data are two free, open-source generators that solve this coherently, and they cite each other as alternatives. The difference is the starting point: datagen starts from a description you write, model2data starts from the database you already have.

datagen: describe the model, compile it, generate fast

datagen has you describe your data model in a simple purpose-built language — entities, fields, relationships — and then compiles that description into native Go code that generates the dataset. Compilation is the differentiator: generation runs fast even at large volumes, which matters when you want millions of coherent rows rather than a demo-sized sample. Models can reference each other with cross-references and tag filtering, and output lands wherever you need it: CSV, JSON, XML, stdout, or written directly into MySQL. It is MIT-licensed, free, and has found real adoption for a niche tool (around 60 GitHub stars).

The honest limits: you are learning a small proprietary DSL rather than reusing a language you already know, the community is small, and there is no commercial support behind it.

model2data: point it at a schema, get data plus a dbt project

model2data is a command-line tool that reads a database schema and generates a full, realistic fake dataset — preserving foreign-key relationships between tables — plus something unusual: a complete, ready-to-run dbt project around it, with seeds, models, tests and profiles scaffolded. For analytics engineers, that collapses a day of setup into one command. Generation is deterministic via a seed parameter, so a teammate running the same command gets the identical dataset, and it recognizes about 35 common field patterns (emails, phone numbers, cities) to make values look plausible. Also MIT, also free.

The honest limits are those of a very young project: about 10 GitHub stars and little battle-testing, heuristic field-type matching that will guess wrong sometimes, no support yet for incremental models or composite foreign keys, and it is specifically a dbt-ecosystem tool, not a general-purpose generator.

Side-by-side

datagenmodel2data
Starting pointA data model you describe in a DSLAn existing database schema
OutputCSV, JSON, XML, stdout, direct MySQLDataset + complete dbt project (seeds, models, tests)
Signature strengthCompiles to native code — fast at big volumesDeterministic, FK-preserving, dbt-ready in one command
License and priceMIT, freeMIT, free
MaturityNiche but adopted (~60 stars)Very young (~10 stars), heuristics imperfect
Best forEngineers needing large custom test datasets, any stackAnalytics engineers on dbt bootstrapping environments

Pick datagen when you need volume and control: big coherent datasets, custom shapes, any output format, and you do not mind an hour learning its DSL. Pick model2data when you live in dbt and the schema already exists — nothing else turns a schema into a working, tested dbt sandbox this directly. Be clear-eyed that both are small young open-source projects: fine to adopt for internal tooling, but there is no vendor to call. If you just need a quick one-off table of plausible rows with zero setup, the long-standing web option mockaroo still covers that simpler case.