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
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
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 version
-------------------------
PostgreSQL 16.0 (GizDB)
(1 row)
OKWhat is inside
SQL that PostgreSQL developers know
Joins, CTEs, window functions,
ON CONFLICT,RETURNING, JSONB, exactnumeric, views and savepoints. Errors carry PostgreSQL SQLSTATE codes.READ COMMITTED, REPEATABLE READ and SERIALIZABLE. Readers never wait for writers.
SIMD column kernels and a parallel executor. TPC-H SF1, all 22 queries, in 2.1 s.
Strings, hashes, lists, sets, sorted sets and TTLs, durable on every write.
SELECT ... FROM changes('orders', after)gives rows as they commit.SELECT * FROM 'sales/*.csv'andread_parquet(...)with no load step.A Gizlang record type is the table. The schema planner follows the type, and
@wasrenames keep data.Online base backups, point-in-time restore, and branches that share sealed files.
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
TPC-H: All 22 queries. PostgreSQL 16: more than 10 min (Q17 and Q20 stopped at 5 min). DuckDB: 0.5 s.
10M-row OLAP: Q6: top-N. PostgreSQL 16 (4 parallel workers): 153 ms. DuckDB: 27 ms.
10M-row OLAP: Q5: `count(DISTINCT c)`. PostgreSQL 16 (4 parallel workers): 1,733 ms. DuckDB: 135 ms.
pgbench: TPC-B, 1 client. PostgreSQL 16: 340 tps.
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
A tutorial: tables, queries and transactions from a Gizlang program.
A service, users, TLS, backups, upgrades and monitoring.
One record type for the table, the queries, the forms and the views.