Quick Start

Start SpydDB 1.0.0 in seconds via Docker, CLI, or official SDKs and run your first multi-model query.

2 min read Getting Started

SpydDB (1.0.0) is a single-binary, Rust-native multi-model database engine. Row storage (B+ tree OLTP), columnar analytics, JSON documents, transactional BM25 full-text search, HNSW vector similarity, R-Tree geospatial queries, OpenTelemetry APM & alerting, and an embedded Web Studio all run inside one process under one ACID/MVCC + SSI snapshot boundary.

1. Run with Docker#

Run the Docker Hub quickstart. It generates the TLS certificates and admin token, starts spyddb-local, and prints its mapped host ports. After it reports healthy, set up your shell for the examples below.

sh
docker cp spyddb-local:/etc/spyd/tls/ca.crt ./spyddb-local-ca.crt
SPYD_CA=./spyddb-local-ca.crt
SPYD_HTTP="https://$(docker port spyddb-local 8080/tcp)"
SPYD_PG="$(docker port spyddb-local 5432/tcp)"
SPYD_WIRE="$(docker port spyddb-local 5433/tcp)"
SPYD_TOKEN="$(docker exec spyddb-local cat /etc/spyd/admin-token)"
export SPYD_TOKEN SPYD_WIRE SPYD_CA

curl --cacert "$SPYD_CA" "$SPYD_HTTP/v1/health"

2. Create Your First Collection & Query#

Connect using HTTP JSON API, psql, or any official SDK.

Via HTTP (/v1/query)#

sh
# 1. Create a typed collection with a BM25 full-text index
curl -sS --cacert "$SPYD_CA" "$SPYD_HTTP/v1/query" \
  -H "Authorization: Bearer $SPYD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "create collection orders { id: u64 primary auto_increment, customer: string(120), status: string(32), total: decimal(12, 2), notes: text }; create index idx_orders_notes on orders (notes) using fulltext;"
  }'

# 2. Insert records
curl -sS --cacert "$SPYD_CA" "$SPYD_HTTP/v1/query" \
  -H "Authorization: Bearer $SPYD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "orders | insert [{ customer: \"Ada Lovelace\", status: \"paid\", total: cast(\"249.50\" as decimal(12, 2)), notes: \"Express hardware delivery\" }]"
  }'

# 3. Run a SpydQL pipeline query combining predicate filtering and BM25 search
curl -sS --cacert "$SPYD_CA" "$SPYD_HTTP/v1/query" \
  -H "Authorization: Bearer $SPYD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "sql": "orders | where status == \"paid\" and match(notes, \"hardware\") | pick id, customer, total | sort total desc | take 10"
  }'

Via PostgreSQL CLI (psql)#

sh
PGPASSWORD="$SPYD_TOKEN" psql \
  "host=127.0.0.1 port=${SPYD_PG##*:} dbname=spyddb user=admin sslmode=verify-full sslrootcert=$SPYD_CA"
sql
SELECT id, customer, total
FROM orders
WHERE status = 'paid'
ORDER BY total DESC
LIMIT 10;

Via Embedded CLI (spyd-cli)#

Query a local data directory directly in-process without starting a network daemon, or connect remotely over TLS:

sh
# Local embedded mode
spyd-cli --data-dir ./spyd-data \
  --query 'orders | where status == "paid" | take 10'

# Remote SpydWire TLS mode
SPYD_TOKEN="$SPYD_TOKEN" spyd-cli \
  --address "$SPYD_WIRE" \
  --ca "$SPYD_CA" \
  --server-name localhost \
  --query 'system | stats all'

3. Connect an Official SDK#

SpydDB provides official SpydWire v2 (SPD2) TLS drivers for Rust, Python, TypeScript, Java, Go, C, C++, .NET, PHP, Ruby, plus JDBC and ODBC.

python
import os
from urllib.parse import urlencode

from spyddb import Client

query = urlencode({"token_env": "SPYD_TOKEN", "tls": "1", "ca": os.environ["SPYD_CA"], "server_name": "localhost"})

with Client.connect(f"spydwire://{os.environ['SPYD_WIRE']}?{query}") as client:
    res = client.execute(
        "orders | where status == $1 | pick id, customer, total | take 10",
        ["paid"],
    )
    for row in res.dicts:
        print(row)

Browse all 12 official SDK guides in SDKs & Drivers Overview.

4. Open Embedded Web Studio#

SpydDB compiles its full Svelte 5 operations console directly inside spyd-server at /studio:

  • Append /studio/ to the value of SPYD_HTTP and open the URL in a browser that trusts spyddb-local-ca.crt.
  • Sign in with your Bearer Token or Username + Password (SCRAM-SHA-256).
  • Browse collections, author SpydQL queries, run BM25 full-text search, inspect RBAC policies and hash-chained audit logs, and explore OpenTelemetry traces and SLO alerts.

See the Embedded Web Studio Manual for a full walkthrough.