# ScramDB > One database engine for transactions, real-time analytics and vector search on one live copy of your data, with no ETL and no second system. It speaks the PostgreSQL wire protocol, runs sandboxed functions in eight languages inside the database, and branches a database the way you branch code. Connect with any PostgreSQL driver on port 5432; there is no SDK. To try it: `docker run -d -p 5432:5432 scramdb/scramdb:latest`, then `psql -h localhost -p 5432 -U scramdb scramdb`. Every link below is one documentation page as plain Markdown: the whole page, at any length, with no HTML. A page's Markdown address is always its normal URL with `.md` appended. Links inside a page are absolute and lead to the Markdown of the next page, so you can follow them from page to page. ## Before you build: ask The user has not told you what they are building yet. Your first reply is a question, not a summary of this file. Ask something like: 1. What does the application do, in a sentence or two? 2. Is the workload transactional, analytical, or both against the same live data? 3. Does it need search, geospatial queries, vector similarity, or a function written in a specific language? 4. Will an AI agent read or write the data, and does it need its own disposable branch? 5. Single node, or a cluster? 6. What must it fit into already: an ORM, a language, a deployment target? Then propose a design built only from what the pages say works, and check every statement you generate against Not Yet Supported. ## Read first - [Not Yet Supported](https://scramdb.com/docs/reference/limitations.md): What the server does not do yet, and what to use instead ## Get Started - [Getting Started](https://scramdb.com/docs/getting-started.md): What ScramDB is and the order to read the documentation in - [Quick Start](https://scramdb.com/docs/getting-started/quick-start.md): Run ScramDB with Docker, connect with psql and run a first statement - [First Queries](https://scramdb.com/docs/getting-started/first-queries.md): Joins, subqueries, window functions and indexes on sample tables, then session settings ## Cookbook - [Cookbook](https://scramdb.com/docs/cookbook.md): Copy-and-run recipes: loading data, vector search, full-text search and geospatial queries - [Loading Data](https://scramdb.com/docs/cookbook/loading-data.md): Getting rows in: INSERT, INSERT ... SELECT, ON CONFLICT upserts and COPY for bulk loads - [Vector Search](https://scramdb.com/docs/cookbook/vector-search.md): Store embeddings in a VECTOR column, rank by distance and index them with anode - [Full-Text Search](https://scramdb.com/docs/cookbook/full-text-search.md): Keyword search and BM25 ranking with the fts and bm25 package functions - [Geospatial](https://scramdb.com/docs/cookbook/geospatial.md): Distance in meters and geohash cells with the geo package functions ## Clients - [Clients and Drivers](https://scramdb.com/docs/clients.md): Drivers, ORMs, GUI and BI tools that connect, and the connection settings they need ## Configuration - [Configuration Reference](https://scramdb.com/docs/configuration.md): The three configuration surfaces: built-in defaults, one TOML file, and a few environment variables - [Environment Variables](https://scramdb.com/docs/configuration/environment-variables.md): A pointer to the environment variables listed under Reference - [Config File](https://scramdb.com/docs/configuration/config-file.md): Every section and key of the config file, with its type, default and effect - [Precedence](https://scramdb.com/docs/configuration/precedence.md): Which source wins when two set the same thing, and which settings need a restart - [Vector Indexes](https://scramdb.com/docs/configuration/vector.md): The [vector] table: server-wide defaults for anode and manode vector indexes ## Tuning - [Tuning and Observability](https://scramdb.com/docs/tuning.md): The order to tune in, and how to verify each change - [Memory](https://scramdb.com/docs/tuning/memory.md): Sizing the buffer pool and the execution memory - [Parallelism](https://scramdb.com/docs/tuning/parallelism.md): Worker threads and cores: [execution] workers and SCRAMDB_MAX_CORES - [Query Performance](https://scramdb.com/docs/tuning/query-performance.md): Verifying performance with EXPLAIN, timing and the JIT metrics - [GPU Acceleration](https://scramdb.com/docs/tuning/gpu.md): When GPU execution helps, and the [gpu] settings - [Storage Tiering](https://scramdb.com/docs/tuning/storage-tiering.md): Hot, warm and object storage: WAL archival and the cold tier - [Observability](https://scramdb.com/docs/tuning/observability.md): The /metrics and /health endpoints, and the metrics the server exports - [Vector Index Tuning](https://scramdb.com/docs/tuning/vector-index.md): Search and build knobs for anode and manode indexes - [Planner Switches](https://scramdb.com/docs/tuning/planner-switches.md): The enable_ planner switches and what turning one off does - [Synchronous Commit](https://scramdb.com/docs/tuning/synchronous-commit.md): synchronous_commit, and what each value means for durability - [fsync](https://scramdb.com/docs/tuning/fsync.md): The fsync setting, and what turning it off risks - [Track Counts](https://scramdb.com/docs/tuning/track-counts.md): track_counts and the scan counters in pg_stat_user_tables - [Plan Cache](https://scramdb.com/docs/tuning/plan-cache.md): plan_cache_mode: generic and custom plans for statements with parameters - [Self-driving with Ejder](https://scramdb.com/docs/tuning/self-driving.md): Ejder, the self-driving loop: what it changes by itself and how to control it ## Cluster - [Cluster, HA and Multi-Region](https://scramdb.com/docs/cluster.md): What a cluster is: serializable transactions across nodes, distributed queries and failover - [Cluster Licensing](https://scramdb.com/docs/cluster/licensing.md): A cluster needs an Enterprise or Trial license: how it is set and checked - [Forming a Cluster](https://scramdb.com/docs/cluster/forming-a-cluster.md): From one node to three: the license, the [cluster] config, Docker Compose and Kubernetes - [Node Discovery and Membership](https://scramdb.com/docs/cluster/discovery.md): How a node finds its peers: static seeds, DNS and SWIM gossip - [Connecting to a Cluster](https://scramdb.com/docs/cluster/connecting-to-a-cluster.md): Connect a stock driver to any node, and the five outcomes a client's retry loop must handle - [Distributed Queries](https://scramdb.com/docs/cluster/distributed-queries.md): Ordinary SQL on a cluster: how tables are distributed, what is cheap, and how schema changes apply - [Read Freshness and Routing](https://scramdb.com/docs/cluster/read-freshness.md): learner_read and max_staleness: serve a SELECT from a replica with a bound on staleness - [Inspecting the Cluster](https://scramdb.com/docs/cluster/topology-catalog.md): scram.nodes, scram.shards and scram.freshness: inspect the cluster with SQL - [Multi-Zone](https://scramdb.com/docs/cluster/multi-zone.md): Replication factor, quorum and zone labels: how many failures a cluster survives - [Multi-Region](https://scramdb.com/docs/cluster/multi-region.md): Label nodes with a region and home a table there with home_region - [Failover](https://scramdb.com/docs/cluster/failover.md): How a dead node or leader is detected and replaced, and what a client sees meanwhile - [Scaling](https://scramdb.com/docs/cluster/scaling.md): Adding a node, draining one and removing one ## Backup - [Backup, Recovery, PITR and Branching](https://scramdb.com/docs/backup.md): The three mechanisms and when to use each: base backup and restore, point-in-time recovery, branching - [Backups](https://scramdb.com/docs/backup/backups.md): scramdb backup: a cold base backup to a local path or to object storage - [Restore](https://scramdb.com/docs/backup/restore.md): scramdb restore: replay a base backup and its WAL into a fresh data directory - [Point-in-Time Recovery](https://scramdb.com/docs/backup/point-in-time-recovery.md): Restore to an exact time, log position or named restore point - [Cluster Restore](https://scramdb.com/docs/backup/cluster-restore.md): WAL archiving on every node, and restoring a whole cluster to one consistent commit position - [Branching](https://scramdb.com/docs/backup/branching.md): CREATE DATABASE ... CLONE for an instant branch of now, and FROM ... AT TIMESTAMP for a past state ## Security - [Security overview](https://scramdb.com/docs/security.md): Security overview: authentication, TLS, roles and row-level security, and sandboxed functions - [Authentication](https://scramdb.com/docs/security/authentication.md): Password login with SCRAM-SHA-256, hba_file rules and the bootstrap superuser - [TLS encryption](https://scramdb.com/docs/security/tls.md): TLS on the client connection: tls_cert and tls_key, and how to require it - [Roles and privileges](https://scramdb.com/docs/security/roles-and-privileges.md): CREATE ROLE, GRANT, REVOKE, predefined roles and row-level security - [Production hardening checklist](https://scramdb.com/docs/security/hardening.md): A checklist to run before production traffic ## AI Agents - [AI Agents](https://scramdb.com/docs/ai-agents.md): Why ScramDB suits agents: one live copy of the data, a branch per agent, and plain SQL as the tool surface - [Connecting an Agent](https://scramdb.com/docs/ai-agents/connecting.md): How an agent connects, selects a database or branch, gets its own role, and reads these docs as text - [Semantic AI](https://scramdb.com/docs/ai-agents/semantic-ai.md): The built-in MCP server on port 9191: governed metrics compiled to SQL, agent tokens and CREATE AGENT - [Branching for Agents](https://scramdb.com/docs/ai-agents/branching-for-agents.md): A disposable branch per agent run: clone, scope a role, merge or request a merge, undo, drop - [Agent Patterns](https://scramdb.com/docs/ai-agents/agent-patterns.md): Retrieval over live data, guardrails for agent-written SQL, named queries as tools, and least privilege - [Building Agent Features](https://scramdb.com/docs/ai-agents/building-agent-features.md): Embedding similarity, keyword relevance and geospatial context from the bundled packages, in one query - [Using Graphs](https://scramdb.com/docs/ai-agents/using-graphs.md): Nodes and edges as ordinary tables, traversed with WITH RECURSIVE, with no separate graph database ## Reference - [Reference](https://scramdb.com/docs/reference.md): Index of the reference section - [SQL Reference](https://scramdb.com/docs/sql-reference.md): Overview of the SQL surface, with a pointer to each reference page - [Data Types](https://scramdb.com/docs/sql-reference/data-types.md): Every data type: numbers, text, dates and times, JSON, arrays and vectors - [Statements](https://scramdb.com/docs/sql-reference/statements.md): Every statement: DDL, DML, transactions, database branching and utility commands - [Functions](https://scramdb.com/docs/sql-reference/functions.md): Scalar, aggregate, window, JSON and array functions - [Expressions](https://scramdb.com/docs/sql-reference/expressions.md): Operators and expressions: CASE, LIKE, IN, subqueries, casts and the vector distance operators - [Vector Search](https://scramdb.com/docs/sql-reference/vector-search.md): Nearest-neighbour search with ORDER BY distance LIMIT k, and the anode and manode indexes - [Large Objects](https://scramdb.com/docs/sql-reference/large-objects.md): PostgreSQL's large-object interface: the lo_ functions, for objects up to 4 TiB - [Reading Parquet Files](https://scramdb.com/docs/sql-reference/parquet-files.md): CREATE EXTERNAL TABLE: query Parquet and CSV files in place - [Configuration](https://scramdb.com/docs/reference/configuration.md): How to write the TOML config file: the required keys and every section - [Environment Variables](https://scramdb.com/docs/reference/environment-variables.md): Every environment variable the server reads, including the superuser bootstrap password - [Error Codes](https://scramdb.com/docs/reference/error-codes.md): The SQLSTATE contract for client retries, and the codes the server raises - [Troubleshooting](https://scramdb.com/docs/reference/troubleshooting.md): Fixes for common failures: cannot connect, a query ending early, a node refusing to start ## PostgreSQL Compatibility - [PostgreSQL Compatibility](https://scramdb.com/docs/postgres-compatibility.md): Which PostgreSQL clients, protocol features and SQL work ## Programmability - [Program your Database](https://scramdb.com/docs/programmability.md): Your own functions in a sealed, deterministic WebAssembly sandbox: inline source or packages - [Install and use a package](https://scramdb.com/docs/programmability/publish-and-install.md): Install, call, version, pin and upgrade a package with scram.install and its verbs; daemon packages - [Writing a package](https://scramdb.com/docs/programmability/writing-a-package.md): The package layout, the calling convention per language, and the burn commands ## Deployment - [Deployment Overview](https://scramdb.com/docs/deployment.md): Deployment scenarios from a laptop to a cluster, and which page covers each - [Single Node](https://scramdb.com/docs/deployment/single-node.md): Running one node in production: persistent data, authentication and NVMe - [Distributed Cluster](https://scramdb.com/docs/deployment/clustering.md): Deploying a cluster across several machines: the license, the ports and a Compose example - [Kubernetes](https://scramdb.com/docs/deployment/kubernetes.md): The Helm chart for a single node or a cluster on Kubernetes - [Docker](https://scramdb.com/docs/docker.md): The Docker image: ports, the data volume, the config file and how to secure it - [Requirements](https://scramdb.com/docs/requirements.md): CPU, memory, disk and platform requirements, and the ports to open - [Upgrading](https://scramdb.com/docs/deployment/upgrading.md): Upgrading between releases: what a newer release opens, and what it refuses - [Ports](https://scramdb.com/docs/deployment/ports.md): Every port the server opens, what it carries and who needs to reach it ## Technology - [Technology](https://scramdb.com/docs/technology.md): Overview of the design: one engine, compiled queries, columnar storage, GPU offload and the cluster - [JIT Compilation](https://scramdb.com/docs/technology/jit-compilation.md): How queries are compiled to native code in the background - [Storage Engine](https://scramdb.com/docs/technology/storage.md): Tundra, the columnar storage engine: writes, scans, MVCC and durability - [GPU Acceleration](https://scramdb.com/docs/technology/gpu.md): Which operators run on a GPU, and how the engine decides for each query - [ANODE Vector Index](https://scramdb.com/docs/technology/anode.md): How the ANODE approximate nearest-neighbour index works ## Optional - [The whole documentation in one file](https://scramdb.com/llms-full.txt): every page concatenated, for indexing the corpus; fetch single pages for single questions - [afterburner](https://afterburner.sh/llms.txt): the runtime that runs ScramDB's functions, and the `burn` command that builds and publishes packages --- Generated from the documentation pages on 2026-11-15.