EMBEDDED SQL. WRITTEN IN GO.

Serious SQL.
A little slop.

Familiar SQL, concurrent transactions, and durable storage. Embed it in Go, open a shell, serve SQL, or grow into a replicated Raft cluster.

Open source · Apache 2.0 · No external server required

A LITTLE GOO. A LOT GOING ON.

Native Go engine Concurrent sessions WAL & crash recovery Raft replication

01 / FOUR WAYS TO RUN IT

In your app. On your terms.

Start with an embedded database.
Open a shell, serve SQL, or bring a cluster online.

IN PROCESS

Embedded

Use Go’s database/sql or the native API. Pooled connections share one engine with independent SQL sessions.

GO · IN THE SLOPDB MODULE
package main

import (
    "database/sql"
    "log"
    _ "slopdb/driver"
)

func main() {
    pool, err := sql.Open(
        "slopdb", "./ideas")
    if err != nil { log.Fatal(err) }
    var hello int
    err = pool.QueryRow(
        "SELECT 1").Scan(&hello)
    closeErr := pool.Close()
    if err != nil { log.Fatal(err) }
    if closeErr != nil {
        log.Fatal(closeErr)
    }
}
AT THE PROMPT

CLI

Explore your data interactively, inspect a schema, or run a SQL file from your terminal.

TERMINAL
# Build from the repository root
go build -o slopdb .

# Open an interactive SQL prompt
./slopdb ./ideas

# Or run a SQL file
./slopdb ./ideas < queries.sql
OVER THE WIRE

Server

Serve MySQL and PostgreSQL clients from one process, with independent session dialects over the same data.

MYSQL + POSTGRESQL
# One engine, both SQL listeners
./slopdb \
  --mysql-tcp 127.0.0.1:3306 \
  --postgres-tcp 127.0.0.1:5432 \
  ./ideas
ACROSS NODES

Raft cluster

Replicate the database with leader-based writes, durable quorum commits, and automatic elections.

BOOTSTRAP THE FIRST NODE
# Set a shared cluster secret
export SLOPDB_RAFT_TOKEN=\
  'replace-with-a-long-random-secret'

# Start the first member
./slopdb --raft-id n1 \
  --raft-bootstrap \
  --raft-listen \
    tcp://127.0.0.1:9400 \
  --raft-control \
    tcp://127.0.0.1:9401 \
  --raft-token-env \
    SLOPDB_RAFT_TOKEN \
  --mysql-tcp 127.0.0.1:3306 \
  ./node-1

Examples assume a build from the repository root. Both SQL listeners share one owning process per database directory. See the protocol guides for SQL compatibility and authentication.

02 / BUILT TO REPLICATE

A little slop.
A proper quorum.

Take the same SQL engine across nodes with HashiCorp Raft. New members clone a snapshot, catch up as learners, and become voters after validated catch-up.

Explore Raft replication
THREE-VOTER TOPOLOGYSYNC MODE
YOUR APPLICATIONMySQL / PostgreSQL
SQL TO THE READY LEADER
N1
LeaderSQL reads & writes
VOTER
NATIVE WAL REPLICATION
N2
FollowerApplies replicated data
N3
FollowerApplies replicated data
2 OF 3

A voting majority durably stores the Raft entry.
The leader durably applies it before acknowledging.

Illustrative steady-state cluster. Followers apply asynchronously; writes require the ready leader.
01

Durable by default.

Sync mode waits for durable storage on a voting majority and durable application on the leader. A three-voter cluster can continue with one voter unavailable.

02

Replicas with a role.

Full voters can lead. Permanent non-voting replicas keep data without changing the quorum. Logs-only voters participate in consensus without materializing SQL tables.

03

Choose how reads catch up.

SQL goes to the ready leader by default. Opt replicas into bounded-staleness or durable-barrier reads, with commit-position tokens to coordinate visibility.

Replica roles, read consistency, and cluster operations

03 / UNDER THE SLIME

Playful name.
Proper database.

Everything starts with a dependable foundation.
Then you make something interesting.

01

SQL you already speak.

A SQLite-like dialect with joins, CTEs, window functions, prepared statements, and the relational constraints your data deserves.

Browse SQL functions
SELECT * FROM possibilities;
02

Room for concurrency.

Independent sessions, atomic transactions, savepoints, and locking reads. MVCC snapshots keep each statement’s view consistent.

Build with transactions
SESSION A → ━━━SESSION B → ━━━
03

Built to hold onto it.

A Go LSM storage engine with durable writes and crash recovery on by default. Add compression, online backups, or Raft replication as you need them.

Look inside the engine
MEMTABLEWALSSTABLES

04 / FROM ZERO TO QUERY

A directory.
A database.
You’re in.

Grab the source and build with Go 1.22.2 or newer.
Your first database is a few commands away.

Follow the getting started guide
YOUR TERMINAL
# 01 — get the source
git clone https://github.com/midom/slopdb.git
cd slopdb

# 02 — build it
go build -o slopdb .

# 03 — make a little space for your data
./slopdb ./example-db

KEEP DIGGING

Good things
under the surface.

SMALL STARTS. INTERESTING POSSIBILITIES.

Put your ideas in the slop.

Explore on GitHub