SpydDB server with SpydWire SPD2, pgwire, HTTP APIs, and official Python, Rust, Node & Java SDKs.
292
SpydDB is a high-performance, security-hardened server database speaking SpydWire v2 (SPD2 canonical binary fast path + SPD1 JSON compatibility) alongside PostgreSQL wire (pgwire) and an authenticated HTTP/1.1 API.
Source repository: GitLab (spydotech-group/spyddb)
Run this from any directory with a local Docker Engine or Docker Desktop. The setup creates a local TLS certificate and a random admin token. It publishes the three listeners on available loopback ports and prints their addresses.
(
set -eu
image=nayem7663/spyddb:latest
docker pull "$image"
docker run --rm --network none --cap-drop ALL \
--mount type=volume,source=spyddb-local-config,target=/etc/spyd \
--entrypoint sh "$image" -eu -c '
cd /etc/spyd
if [ -s local.json ]; then exit 0; fi
if ! grep -q "replace-this-token-from-a-secret-manager" server.json; then
printf "%s\n" "SpydDB configuration template is missing or has changed." >&2
exit 1
fi
umask 077
tmp=$(mktemp -d .setup.XXXXXX)
trap "rm -rf -- \"$tmp\"" EXIT
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout "$tmp/ca.key" -out "$tmp/ca.crt" -days 365 \
-subj "/CN=SpydDB Local CA" -addext "basicConstraints=critical,CA:TRUE" \
-addext "keyUsage=critical,keyCertSign,cRLSign"
openssl req -new -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout "$tmp/server.key" -out "$tmp/server.csr" -subj "/CN=localhost" \
-addext "subjectAltName=DNS:localhost,IP:127.0.0.1" \
-addext "basicConstraints=critical,CA:FALSE" -addext "extendedKeyUsage=serverAuth"
openssl x509 -req -in "$tmp/server.csr" -CA "$tmp/ca.crt" -CAkey "$tmp/ca.key" \
-days 365 -copy_extensions copy -out "$tmp/server.crt"
token=$(openssl rand -hex 32)
sed "s/replace-this-token-from-a-secret-manager/$token/" server.json > "$tmp/local.json"
printf "%s\n" "$token" > "$tmp/admin-token"
mv "$tmp/ca.crt" "$tmp/server.crt" "$tmp/server.key" tls/
mv "$tmp/admin-token" admin-token
mv "$tmp/local.json" local.json
'
docker run -d --name spyddb-local --cap-drop ALL \
-p 127.0.0.1::5433 -p 127.0.0.1::5432 -p 127.0.0.1::8080 \
--mount type=volume,source=spyddb-local-data,target=/var/lib/spyd \
--mount type=volume,source=spyddb-local-config,target=/etc/spyd,readonly \
"$image" --config /etc/spyd/local.json
attempts=0
until docker exec spyddb-local curl -fsS --cacert /etc/spyd/tls/ca.crt \
https://127.0.0.1:8080/v1/health 2>/dev/null; do
attempts=$((attempts + 1))
if [ "$attempts" -ge 30 ]; then docker logs --tail 40 spyddb-local; exit 1; fi
sleep 1
done
printf '\nPublished ports (container → host):\n'
docker port spyddb-local
)
To open Web Studio, trust the local CA in your browser and open the URL printed below. Sign in with the admin token. The same CA lets command-line clients verify TLS.
docker cp spyddb-local:/etc/spyd/tls/ca.crt ./spyddb-local-ca.crt
printf 'Web Studio: https://%s/studio/\n' "$(docker port spyddb-local 8080/tcp)"
docker exec spyddb-local cat /etc/spyd/admin-token
Copy the token only into clients you trust. Use docker stop spyddb-local to stop the server and docker start spyddb-local to bring it back with the same data and credentials.
For a custom deployment, create a server.json file and place the certificate and private key at the paths it specifies. Use --mount for read-only bind mounts so Docker reports a missing source path directly. Run test -f ./server.json before mounting the file. A directory at that path may be left over from an earlier -v command. See the operations guide for production configuration.
All four published SDKs connect directly over TLS SpydWire SPD2 (5433/tcp) and provide synchronous and asynchronous APIs plus type-safe ORMs:
| Language | Package | Registry | Version | Highlights |
|---|---|---|---|---|
| Python | spyddb | PyPI | 1.0.0 | Sync driver, native asyncio AsyncClient / AsyncPool, and ORM |
| Rust | spyd-rust-driver | crates.io | 1.0.0 | Sync driver, opt-in Tokio async feature, and ORM; core crates: spyd-wire, spyd-core |
| Node.js / TypeScript | spyddb | npm | 1.0.0 | Native async SPD2 driver, pooling, and TypeScript ORM |
| Java 21+ | io.github.muhibnayem:spyddb-client | Maven Central | 1.0.0 | Virtual-thread sync & CompletableFuture async (SpydAsyncClient), HTTP client, and Java ORM |
Additional language clients (C, C++, Go, .NET, JDBC, ODBC, PHP, Ruby) live in the source repository.
# Python (PyPI)
pip install spyddb==1.0.0
# Node.js / TypeScript (npm)
npm install spyddb
# Rust (crates.io)
cargo add spyd-rust-driver --features async
<!-- Java 21+ (Maven Central) -->
<dependency>
<groupId>io.github.muhibnayem</groupId>
<artifactId>spyddb-client</artifactId>
<version>1.0.0</version>
</dependency>
// Java 21+ (Gradle Kotlin DSL — Maven Central)
implementation("io.github.muhibnayem:spyddb-client:1.0.0")
5433/tcp — SpydWire (SPD2 binary & SPD1 JSON framed protocol over TLS/TCP)5432/tcp — PostgreSQL wire protocol (pgwire v3 over TLS/TCP)8080/tcp — Authenticated HTTP/1.1 query & management API (/v1/query, /v1/catalog, /v1/health)9090/tcp — Loopback health/readiness and Prometheus metrics (/readyz, /healthz, /metrics)UID 999 / GID 999).certificate + private_key mounted in /etc/spyd/tls).SPD2 frame/depth/bounds checks.docker pull nayem7663/spyddb:latest