edg#

An Expression-based Data Generator driven by YAML configuration.

The reason for edg#

edg was built to help you understand how your database will behave when production traffic arrives. Connect to one of the supported databases, create database objects, seed realistic amounts of data quickly, and define transactional workloads; all from YAML. Concurrent workers and real-time throughput reporting will take of the rest.

Query arguments are written as expressions compiled at startup, giving you access to global constants, random data generation, reference lookups, and a bunch of random distributions.

Supported databases#

DatabaseDriverURL (example)
Aurora DSQLdsqlclusterid.dsql.us-east-1.on.aws
Cassandracassandracassandra://user:pass@host1[,host2,host3]:9042/keyspace
CockroachDB / PostgreSQLpgxpostgres://root@localhost:26257/db?sslmode=disable
Google Cloud Spannerspannerprojects/PROJECT/instances/INSTANCE/databases/DATABASE
MongoDBmongodbmongodb://localhost:27017/db
MSSQLmssqlsqlserver://user:password@host:port?database=db&encrypt=disable
MySQLmysqluser:password@tcp(host:port)/db?parseTime=true
Oracleoracleoracle://system:password@localhost:1521/db

Supported features#

Featurepgxmysqlmongodbcassandramssqloracledsqlspanner
up / seed / run / deseed / down☑️☑️☑️☑️☑️☑️☑️☑️
sync run / down☑️☑️☑️☑️☑️☑️☑️☑️
sync verify☑️☑️☑️☑️☑️☑️☑️☑️
init (schema introspection)☑️☑️⚠️🚫☑️☑️☑️☑️
Batch operations☑️☑️☑️☑️☑️☑️☑️☑️
Expectations☑️☑️☑️☑️☑️☑️☑️☑️
Prepared statements☑️☑️⚠️🚫☑️☑️☑️☑️
Stages☑️☑️☑️☑️☑️☑️☑️☑️
Transactions☑️☑️☑️ 1☑️ 2☑️☑️☑️☑️
Workers☑️☑️☑️☑️☑️☑️☑️☑️

☑️ Supported · 🚫 Not yet supported · ⚠️ Not applicable

Quick start#

Install with the Go toolchain.

go install github.com/codingconcepts/edg@latest

Run all of the configured config steps.

edg all \
--driver pgx \
--config _examples/tpcc/crdb.yaml \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 100 \
-d 5m

  1. Implemented using multi-document transactions via client sessions. ↩︎

  2. Implemented using logged batches, which guarantee atomicity but not isolation. ↩︎