GizStack

GizDB

One database for every kind of data.

Transactions, analytics, key-value data, change feeds and search in one engine and one transaction. Embed it in your program with one import, or run it as a server that psql and redis-cli already speak.

Coming In development. This is the design it ships to. Roadmap

Embedded: a database in one import

gizlang
import {System} from "gizlang:system";
import {open, connection} from "gizdb";

export function main(sys: System): void {
    let db = open(sys.directory("notes-data")!)!;
    let c = connection("postgres");
    c.run(db, "CREATE TABLE IF NOT EXISTS notes (id int PRIMARY KEY, title text)", [], 0, 0u)!;
    c.run(db, "INSERT INTO notes VALUES (1, 'Buy milk') ON CONFLICT DO NOTHING", [], 0, 0u)!;
    db.close()!;
}

No server, no driver, no connection pool. The compiled module links into your executable, and the first run starts in under a second.

A server: PostgreSQL and Redis on the same data

sh
curl -fsSL https://gizstack.com/install | sh -s -- --only gizdb   # the server alone
gizdb serve --dir data --port 5432 --kv-port 6379
psql -h 127.0.0.1 -U postgres -c "SELECT version()"
redis-cli -p 6379 SET greeting hello
text
         version
-------------------------
 PostgreSQL 16.0 (GizDB)
(1 row)

OK

What is inside

  • SQL that PostgreSQL developers know

    Joins, CTEs, window functions, ON CONFLICT, RETURNING, JSONB, exact numeric, views and savepoints. Errors carry PostgreSQL SQLSTATE codes.

  • Snapshot transactions

    READ COMMITTED, REPEATABLE READ and SERIALIZABLE. Readers never wait for writers.

  • Columnar analytics

    SIMD column kernels and a parallel executor. TPC-H SF1, all 22 queries, in 2.1 s.

  • Redis protocol

    Strings, hashes, lists, sets, sorted sets and TTLs, durable on every write.

  • Live queries

    SELECT ... FROM changes('orders', after) gives rows as they commit.

  • Files as tables

    SELECT * FROM 'sales/*.csv' and read_parquet(...) with no load step.

  • Typed queries

    A Gizlang record type is the table. The schema planner follows the type, and @was renames keep data.

  • Backup, restore and branch

    Online base backups, point-in-time restore, and branches that share sealed files.

  • Dialects

    SET sql_dialect = 'sqlite' and other dialects in the same server.

Durable by test

kill -9 during commits: 68,412 acknowledged, all whole after 1,000 kills transactions. Nothing else was present after a restart. A full disk turns the server read-only, not down. Method →

Measured

  • 2.1 s

    TPC-H: All 22 queries. PostgreSQL 16: more than 10 min (Q17 and Q20 stopped at 5 min). DuckDB: 0.5 s.

  • 7 ms

    10M-row OLAP: Q6: top-N. PostgreSQL 16 (4 parallel workers): 153 ms. DuckDB: 27 ms.

  • 121 ms

    10M-row OLAP: Q5: `count(DISTINCT c)`. PostgreSQL 16 (4 parallel workers): 1,733 ms. DuckDB: 135 ms.

  • 394 tps

    pgbench: TPC-B, 1 client. PostgreSQL 16: 340 tps.

  • 47,036 req/s

    Redis protocol: GET, synced every second. Redis 7.4: 133,333 req/s.

  • 68,412 acknowledged, all whole after 1,000 kills

    Durability: Acknowledged transactions whole after the kills.

Dates, machine and method: benchmarks.

Next steps

  • Use GizDB

    A tutorial: tables, queries and transactions from a Gizlang program.

  • Operate the server

    A service, users, TLS, backups, upgrades and monitoring.

  • Model your data

    One record type for the table, the queries, the forms and the views.