Distributed PostgreSQL backed by FoundationDB.
Setup FoundationDB (https://apple.github.io/foundationdb/) on your machine.
$ go mod tidy
$ go build
$ ./fakegres-fdb -pg-port=6000 -reset=false -columnar=false
$ psql -h localhost -p 6000
psql> create table customer (age int, name text);
psql> insert into customer values(14, 'garry'), (20, 'ted');
psql> select name, age from customer;This builds on top of Fakegres + SQLite (tweet).
Basically, this is 0.00001 version of SQL over KV, the idea is not new at all. CockroadchDB does it in production and have heavily documented it. and even Foundation DB had an SQL layer that is not longer maintained.
I wanted to learn data modeling with Foundation DB and this was one my didn't get to it projects at Recurse.
The code is heavily commented to show my intent, needless to say this is very WIP.
- Data modeling in Foundation DB
- The architecture of a distributed SQL database, part 1: Converting SQL to a KV store
- CockroachDB: Architecture of a Geo-Distributed SQL Database
- CockroachDB's v3 encoding
- CockroachDB's v2 encoding
- CockroachDB's v1 encoding
- FoundationDB SQL Layer (community)
- What's the big deal about key-value databases like FoundationDB and RocksDB?