Skip to content

minifish-org/tegdb-server

Repository files navigation

tegdb-server

TegDB Server is a PostgreSQL-compatible database server built on top of TegDB, designed for progressive scalability from single-node to distributed deployments.

Quick start

Requirements

  • Rust (stable)

Build

cargo build

Configure

Create config.toml (example):

[server]
bind_addr = "127.0.0.1:5432"

[storage]
base_path = "/tmp/tegdb-server-data"

Notes:

  • storage.base_path must be an absolute path.

Run

cargo run

Connect (psql)

psql -h 127.0.0.1 -p 5432 -U postgres

MVP compatibility

Supported protocol slice

  • Startup + AuthenticationOk (trust/no-password)
  • Simple Query (Query message)
  • Responses: RowDescription/DataRow/CommandComplete/ErrorResponse/ReadyForQuery

Known limitations (MVP)

  • No SSL (SSLRequest is answered with N)
  • No extended query protocol (Parse/Bind/Execute)
  • No prepared statements
  • Transactions are not supported yet (BEGIN/COMMIT/ROLLBACK return an error)

Sysbench (TegDB script)

This repo includes a TegDB-compatible sysbench Lua script for point selects:

  • sysbench/oltp_point_selects_tegdb.lua

It avoids prepared statements and explicit transactions and uses a TegDB-compatible schema:

  • TEXT(n) (fixed length) instead of CHAR(n) / VARCHAR(n)
  • no DEFAULT clauses
  • no secondary indexes

Prepare

sysbench sysbench/oltp_point_selects_tegdb.lua \
  --db-driver=pgsql \
  --pgsql-host=127.0.0.1 \
  --pgsql-port=5432 \
  --pgsql-user=postgres \
  --pgsql-password='' \
  --pgsql-db=sbtest \
  --tables=4 \
  --table-size=10000 \
  --create_secondary=off \
  --auto_inc=off \
  prepare

Run

sysbench sysbench/oltp_point_selects_tegdb.lua \
  --db-driver=pgsql \
  --pgsql-host=127.0.0.1 \
  --pgsql-port=5432 \
  --pgsql-user=postgres \
  --pgsql-password='' \
  --pgsql-db=sbtest \
  --tables=4 \
  --table-size=10000 \
  --threads=32 \
  --time=120 \
  --events=0 \
  --report-interval=10 \
  --skip-trx=on \
  --db-ps-mode=disable \
  --create_secondary=off \
  --auto_inc=off \
  run

Cleanup

sysbench sysbench/oltp_point_selects_tegdb.lua \
  --db-driver=pgsql \
  --pgsql-host=127.0.0.1 \
  --pgsql-port=5432 \
  --pgsql-user=postgres \
  --pgsql-password='' \
  --pgsql-db=sbtest \
  --tables=4 \
  cleanup

Development guide

See AGENTS.md for architecture, conventions, and quality requirements.

About

**TegDB Server** is a PostgreSQL-compatible database server built on top of [TegDB](https://github.com/minifish-org/tegdb), designed for **progressive scalability** from single-node to distributed deployments.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors