Skip to content

High-volume card transactions with bounded resources

A composed, transaction-like dataset that scales to hundreds of thousands of rows while generating in bounded memory.

composed volume large TransactionsFinanceBankingVolume
Languages
eng
Formats
csv

Recipe

recipe.gbddl
gbddl 1
language eng

table merchants rows 10000 (
  id            int64 autoincrement primarykey
  merchant_code text unique pattern(pattern: "MCH-#######")
  name          text company()
  category      text enum(values: ["retail", "food", "travel", "services", "digital"])
  country       text same(geo) country()
  city          text same(geo) city()
  currency      text same(geo) currency()
)

table terminals rows 50000 (
  id            int64 autoincrement primarykey
  terminal_code text unique pattern(pattern: "TRM-#########")
  model         text enum(values: ["VX-520", "VX-820", "P400", "A920", "ICT-250"])
  region        text enum(values: ["north", "south", "east", "west"])
  status        text enum(values: ["active", "inactive", "maintenance"])
  installed_on  date date(min: "2020-01-01", max: "2025-12-31")
)

table transactions rows 200000 (
  id         int64 autoincrement primarykey
  txn_ref    text unique pattern(pattern: "TXN-##########")
  amount     decimal(12, 2) decimal(min: 0.01, max: 100000)
  currency   text same(geo) currency()
  country    text same(geo) country()
  card_brand text enum(values: ["visa", "mastercard", "amex", "discover"])
  channel    text enum(values: ["pos", "online", "atm", "mobile"])
  status     text enum(values: ["approved", "declined", "pending", "reversed"])
  at         timestamp datetime(min: "2024-01-01 00:00:00", max: "2025-12-31 23:59:59")
)

output csv

This is the exact recipe.gbddl committed to the repository. Copy it, or download the raw source.

About this recipe

High-volume transactions

A composed, transaction-like recipe that generates a large payment dataset — merchants, terminals and transactions — with 200,000 transaction rows plus 50,000 terminal rows and 10,000 merchant rows. It exists to prove the pipeline stays within bounded memory at scale, not to model a balanced ledger.

What it demonstrates

  • Large volume — transactions holds 200,000 rows (about 260,000 rows across the three tables), enough to exercise the disk-backed generation path and show the memory profile does not grow with the row count.
  • Bounded memory — every cell is a pure function of the seed and its row coordinates, so a row is generated and written one at a time and never buffered. The merchant_code, terminal_code and txn_ref keys are unique by construction (a keyed permutation of the pattern value space), so uniqueness needs no in-memory set of already-seen values.
  • Coherent geography — merchants and transactions draw their country, city and currency from one same(geo) group, so each row's currency matches its country.
  • Transaction shape — transactions carries a unique reference, a signed amount, a card card_brand, a channel, a status and an at timestamp.

Run it

Submit the recipe body to POST /api/v1/jobs?input_format=gbddl, or paste it into Chef, to generate the data. The repository's local runner (run by task test) also generates it and verifies its output, and the full task test:all gate runs the same generation through the disk-backed command that streams the files to a directory.

The recipe outputs one flat CSV file per table: merchants.csv, terminals.csv and transactions.csv.

Adapt it

  • Raise transactions to millions of rows to stress the bound further; the column layout and construction-mode uniqueness are unchanged by volume.
  • Narrow amount with min/max or extend the channel and card_brand enums to match a real card scheme.
  • Swap pattern for a regexp or an integer reference if you need a different identifier shape.

Table relationships

The three tables are composed rather than related: they describe one payment domain but declare no foreign keys, so metadata.json carries kind composed. merchants is the merchant directory, terminals the point-of-sale fleet, and transactions the large fact stream. If you want transactions to name a specific merchant or terminal row, add a fk(...) column and change the kind to related.

Expected outputs

  • merchants.csv — 10,000 rows.
  • terminals.csv — 50,000 rows.
  • transactions.csv — 200,000 rows.

Each file begins with a header row naming the columns, and every declared column is populated for every row.

Guarantees

Every primary key is unique and auto-increments by row; merchant_code, terminal_code and txn_ref are each unique; same(geo) keeps each row's country, city and currency coherent; amount stays inside [0.01, 100000]; and installed_on/at stay inside their declared ranges. The verify step checks row counts, key uniqueness, exact null counts, ranges and the same(geo) coherence. The amounts are synthetic and not balanced like a real ledger.

Limitations

  • The tables are independent: there is no foreign key tying a transaction to a merchant or terminal, so the dataset cannot answer relational join questions without the reader joining on business keys.
  • Values are synthetic. Card brands, channels, statuses and amounts are plausible but carry no real-world distribution.

Memory bound

Generation is bounded: the engine computes one row at a time from the seed and the row index (no per-row accumulation), uniqueness uses construction-mode permutations instead of a growing set, and the CSV encoder writes each row to a buffered stream as it goes. The large profile is exercised by the disk-backed Generate path, which writes the three files to a directory rather than holding them in memory, so peak memory stays constant whether transactions has 200,000 rows or 5,000,000.

Tested features

Smart types, physical types, rules and formats this recipe exercises and verifies.

patterncompanyenumcountrycitycurrencydatedatetimedecimalautoincrementprimary-keyuniquesame:geography