Lyrebird Community 0.5.8 is free · Generate a synthetic test database on your own machine · Download

Synthetic data generation for relational databases

What synthetic data generation means

Synthetic data generation creates new data that mimics real-world records without copying them. The goal is usually the same: production-like data for testing, development, or analysis, with no real customer rows.

In practice, “synthetic data generation” covers very different jobs. Filling a list with fake names and emails is one; producing a test database with schema, primary and foreign keys, and table ratios is another. The second job is harder. This page focuses on synthetic data generation for relational databases: it compares methods, shows where they break, and what to check before you choose a tool.

See which tables and constraints a synthetic database preserves, and when a test data generation workflow calls for more than a mock CSV.

One table is not a relational database

Generating a single realistic table is relatively easy. A list of fake names and emails is a few lines of code. In a relational database, value lives in connections:

  • Every foreign key must point at a real parent row. An order without a customer fails constraint checks on load and breaks joins.
  • Ratios between tables matter. If the source has dozens of orders per customer and you generate one order per customer, slow queries that only show up on large child tables stay hidden in test.
  • Columns depend on each other. A delivery date cannot precede an order date; cities belong to countries; status values follow real distributions, not flat randomness.
  • Reference data must not bloat. Country, currency, or category tables should not grow a hundredfold when you scale event tables.
  • Composite and self-referencing keys must stay valid.

Four common approaches

A generator that ignores these rules may produce loadable data that tells you little about how the application behaves on real data. Choosing a method is deciding who writes those rules: you, or a tool that reads the schema.

ApproachHow it worksPrivacyRealismEffort
Hand-written seed scripts Developers write INSERTs or fixturesSafeLow: few rows, few edge casesHigh and ongoing
Random libraries (Faker-style) Code fills each column with plausible valuesSafeModerate per column, weak across tablesHigh: you write relational logic
Masked production copy Production is copied; sensitive columns are maskedReal rows remainHighSlow refresh, large storage, audit scope
Profile-based synthetic generation Schema, relationships, and value patterns learned once; new rows generatedNo production rows copiedHigh including relationshipsLow after the first profile

How profile-based generation works

The approach has two phases.

1. Analyze once. The tool connects read-only to the source; it records schema, primary and foreign keys, table sizes and ratios, and per-column value patterns. The result is a small profile file: a recipe, not a copy.

2. Generate as much as you need. The generator works only from the profile, building parent tables before children, giving every child a valid parent key, and filling each column from learned patterns. You can scale the whole database up or down while preserving ratios.

Because the second phase needs only the profile, it can run on a laptop, in a CI job, or on an air-gapped network without touching production again. You are not forced to tie synthetic data generation to a cloud service — as long as the tool you pick actually runs locally.

What to verify before you choose

Before adopting a tool, try these points on your own schema. The synthetic data quality checklist shows how we measured a generated PostgreSQL database and where a result can still miss an edge case.

  • Referential integrity on load. Load output into a real database with constraints enabled and count broken foreign keys. The right number is zero.
  • Engines you actually use. PostgreSQL, MySQL, SQL Server, and Oracle each have their own types, identity columns, and bulk loaders. See the tool work on your engine and your schema.
  • Reproducibility. The same profile, settings, and seed should yield the same data every time; otherwise reproducing a broken CI job is painful.
  • Scale. A small dev copy and a larger load test should both come from the same recipe without distorting table ratios.
  • Where data stays. Do profiling and generation run in your environment, or do rows and schema go to a service? For teams in GDPR or KVKK scope, that matters as much as the method.

How Lyrebird approaches this

Lyrebird is Subsetra's implementation of the profile-based approach above. It reads the source once, read-only; reduces schema, relationships, and value patterns into a .lyre profile; then generates synthetic test databases offline on your machines with foreign keys intact. There is no external AI API.

Community is free: local profiling and up to 5,000 synthetic rows per table. Larger volume and pipeline headless CLI are in Enterprise. Four engines are supported: PostgreSQL, MySQL, SQL Server, and Oracle — including cross-engine generation, for example Oracle profile to PostgreSQL.

Product detail is on the Lyrebird page. Measured times, broken-key counts, and CI examples are there and in the 10 million rows on Pagila post. Security and operations questions CTOs ask are in how Lyrebird generates synthetic data.

You can compare source and synthetic sides of four public schemas in the browser at sample databases without touching production. To see your own schema, request a demo.

FAQ

Common questions.

What is synthetic data generation?

It is creating new data that was not copied from real records but still follows the structure and statistical patterns of the source. In a relational database, that means generating a complete test database — tables, keys, and ratios between tables — not only column values.

Why might Faker or random libraries not be enough?

These libraries fill columns one at a time with plausible values. You must write the foreign-key graph, table ratios, and cross-column rules yourself. As the schema grows, that effort becomes continuous and loads often break under enforced constraints.

What is the difference between masking and synthetic generation?

With masking, production rows remain; sensitive columns are altered. With synthetic generation, new rows are produced and production rows are not copied. Masking or subsetting may fit when you must reproduce a specific real record. Synthetic generation fits when you need production-like data without real rows.

Must generation stay connected to the source?

Not with a profile-based approach. The source is read once, read-only, to extract a profile; later generation uses that file without reconnecting. Lyrebird uses this model and runs generation in your environment, offline.