Skip to content

Connectivity Overview

ParticleDB exposes five network protocols, each optimized for different workloads. The PostgreSQL wire protocol is the primary interface for SQL queries; the other protocols serve specialized roles.

ProtocolDefault PortUse CaseClient Libraries
PostgreSQL Wire5432SQL queries, transactions, prepared statements, pipeline modeAny PostgreSQL driver (psycopg2, pg, pgx, JDBC, Npgsql, tokio-postgres, …)
gRPC26257Admin operations, inter-node communication, streamingAny gRPC client (grpcurl, language-specific stubs)
HTTP API8080REST queries, KV operations, health checks, dashboard, metricscurl, any HTTP client
Redis RESP6379Key-value operations, caching workloadsAny Redis client (redis-py, ioredis, redis-rs, …)
WebSocket8081Real-time subscriptions, live query resultsAny WebSocket client
Terminal window
# psql
psql -h localhost -p 5432 -d main
# Connection string (works with any PG driver)
postgresql://localhost:5432/main
# Unix socket (lowest latency)
psql -h /tmp -d main
Terminal window
grpcurl -plaintext localhost:26257 particledb.Admin/GetStatus
Terminal window
# Health check
curl http://localhost:8080/health
# Execute a query
curl -X POST http://localhost:8080/query \
-H "Content-Type: application/json" \
-d '{"sql": "SELECT COUNT(*) FROM products"}'
# KV get
curl -X POST http://localhost:8080/v1/kv/get \
-H "Content-Type: application/json" \
-d '{"key": "user:1001", "table": "kv_store"}'
# KV set
curl -X POST http://localhost:8080/v1/kv/set \
-H "Content-Type: application/json" \
-d '{"key": "user:1001", "value": "Alice", "table": "kv_store"}'
# Server version
curl http://localhost:8080/v1/version
Terminal window
redis-cli -p 6379
> SET user:1001 '{"name":"Alice"}'
> GET user:1001

All ports are configurable via CLI flags, config file, or environment variables:

ProtocolCLI FlagConfig KeyEnv Variable
PG Wire--pg-addrnetwork.pg_addrPDB_PG_ADDR
PG Unix Socket--pg-unix-socketnetwork.pg_unix_pathPDB_PG_UNIX_PATH
gRPC--grpc-addrnetwork.grpc_addrPDB_GRPC_ADDR
HTTP--http-addrnetwork.http_addrPDB_HTTP_ADDR
Redisnetwork.redis_portPDB_REDIS_PORT

See Configuration for the full reference.

All protocols support TLS encryption and authentication. See TLS / Security for setup instructions.

ProtocolTLSAuth Methods
PG WireYestrust, password, md5
gRPCYesToken-based
HTTPYesBearer token, Basic auth
Redis RESPYesAUTH command
WebSocketYes (wss://)Token in handshake
  • SQL workloads (OLTP and OLAP) — Use the PostgreSQL wire protocol. It supports the full SQL dialect, transactions, prepared statements, binary format, and pipeline mode for maximum throughput.
  • Admin and ops — Use gRPC for cluster management, node status, and backup operations.
  • Dashboards and lightweight integrations — Use the HTTP API for simple query execution, health checks, and Prometheus metrics.
  • Key-value workloads — Use the Redis RESP protocol with any Redis client library for GET/SET/SCAN operations.
  • Real-time updates — Use WebSocket for live query subscriptions and change notifications.