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": "ken@dummy.org",
"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 seedThe 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 runAs a docker container:
make docker.build
make docker.runwrk -t12 -c100 -d10s --latency http://127.0.0.1:8000/users/100More about the load testing tool wrk.