Drizzle has always been fast, we just wanted you to have a meaningful benchmarks experience
We ran our benchmarks on 2 separate machines, so that observer does not influence results. For database we're using PostgreSQL instance with 42MB of E-commerce data(~370k records).
K6 benchmarking instance lives on MacBook Air and makes 1M prepared requests through 1GB ethernet to Lenovo M720q with Intel Core i3-9100T and 32GB of RAM.
To run your own tests - follow instructions below!
- Spin up a docker container with PostgreSQL using
pnpm start:docker
command. You can configure a desired database port in./src/docker.ts
file:
...
}
const desiredPostgresPort = 5432; // change here
main();
- Update
DATABASE_URL
with allocated database port in .env file:
DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres"
- Seed your database with test data using
pnpm start:seed
command, you can change the size of the database in./src/seed.ts
file:
...
}
main("micro"); // nano | micro
- Make sure you have Node version 18 installed or above, we've used Node v22. You can use
nvm use 22
command - Start Drizzle/Prisma server:
## Drizzle
pnpm start:drizzle
## Prisma
pnpm prepare:prisma
pnpm start:prisma
- Generate a list of http requests with
pnpm start:generate
. It will output a list of http requests to be run on the tested server |./data/requests.json
- Install k6 load tester
- Configure tested server url in
./k6.js
file
// const host = `http://192.168.31.144:3000`; // drizzle
const host = `http://192.168.31.144:3001`; // prisma
- Run tests with
k6 run bench.js
🚀