convert jsonl to json
cat 10000-users.jsonl | jq --slurp > 10000-users.json
start a database
docker run --rm --name jsonl-demo-postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres
create a table to store the test data in
docker exec -it jsonl-demo-postgres psql -d postgres://postgres:postgres@localhost:5432/postgres -c 'create table users (user_id serial PRIMARY KEY, name varchar(255), email varchar(255));'
create test json lines file containing 30000 users
for run in {1..30000}; do (cat user.json >> 30000-users.jsonl); done
make a request towards the service
curl -X POST --data-binary @3000-users.jsonl http://localhost:8000
run the service
DB_URI=postgres://postgres:postgres@localhost:5432/postgres node naive.js