Skip to content

kafaichoi/ex_db

Repository files navigation

ExDb

A simple, educational Postgres-compatible database written in Elixir.

Project Goal

Build a minimal, understandable database server that speaks the Postgres wire protocol and implements core database features, step by step.

Roadmap

  1. Wire Protocol with Server: Accept client connections and speak the Postgres protocol.
  2. SQL Parser: Parse incoming SQL queries.
  3. In-Memory Storage & Buffer Pool: Store data in memory with a basic buffer pool.
  4. Query Executor: Execute parsed queries against the in-memory storage.
  5. Persistence (Disk Storage): Add disk-based storage for durability.
  6. Transactions & WAL: Support transactions and implement Write-Ahead Logging.
  7. B-tree Indexes: Add indexing for efficient data retrieval.
  8. Advanced Features: Implement joins and other advanced SQL features.

This project is for learning and experimentation. Contributions and questions are welcome!

Installation

If available in Hex, the package can be installed by adding ex_db to your list of dependencies in mix.exs:

def deps do
  [
    {:ex_db, "~> 0.1.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ex_db.

Wire Protocol 3.0

Startup Packet start with the length followed by the protocol version. |int32 len|int32 protocol|payload| |int32 len|int32 protocol|str name|\0|str value|\0| All other message start with an ASCII identifier, followed by length and payload |char tag|int32 len|payload|

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages