A simple containerized Go API backed by DuckDB.
The service exposes GET http://localhost:8000/users/:id
endpoint which returns user details from DuckDB running in persistent mode.
API response:
{
"id": 1,
"name": "Ken Adams",
"email": "[email protected]",
"joined_date": "2021-09-12T05:13:37Z"
}
The service uses go-duckdb pkg to interact with DuckDB C++ shared lib.
# populates 100K records in duckdb
make seed
# with custom seed size
SEED_COUNT=200000 make seed
The seed command generates testdata/test.duckdb
duckdb file necessary to run the service. It contains users
table which has following columns:
id | INTEGER |
name | VARCHAR |
VARCHAR | |
joined_date | TIMESTAMP |
Normally:
make build
make run
As a docker container:
make docker.build
make docker.run
wrk -t12 -c100 -d10s --latency http://127.0.0.1:8000/users/100
More about the load testing tool wrk.