lbadd

module
v0.0.0-...-df1ffc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2020 License: MIT

README

LBADD

Let's build a distributed database.



LBADD is an experimental distributed SQL database, written in Go.

The goal of this project is to build a database from scratch which is well documented, fully tested, and easy to understand. Implementing as much as possible from the ground up.

It is also currently a work in progress. Feel free to follow along with the development of each component, from parser to pager.

Architecture

The database is made up of a few separate components. These handle the SQL parsing, the intermediary representation generation, the multi-node consensus, the execution of the IR, and the (persistent) storage.

For a brief overview of the purpose of each component, have a look at the overview.

Prior art

Inspiration has been taken from the brilliantly documented codebase of SQLite. However the codebase has been heavily optimized, and is difficult to follow without spending significant time.

Work has also already been done to build a distributed version of SQLite called rqlite. The project uses raft consensus in order to keep nodes consistent across the network.

LBADD aims to replicate these in a single project. LBADD doesn't aim to be nearly as performant as SQLite nor rqlite, and hopefully trades this instead for slightly more clarity and simplicity.

Contributing

Contributors are more than welcome and much appreciated. Please feel free to open a PR to improve anything you don't like, or would like to add. No PR is too small! Go check out our contributing guide for more detailed info about how to get started with a contribution.

License

This project is licensed under the MIT license.

Directories

Path Synopsis
cmd
Package driver implements an SQL driver for an lbadd database.
Package driver implements an SQL driver for an lbadd database.
test
Package test contains all integration tests that were created as regression tests for issues that were fixed.
Package test contains all integration tests that were created as regression tests for issues that were fixed.
internal
compiler
Package compiler provides compiler implementations for compiling an (*ast.SQLStmt) into a (command.Command), which then can be executed by an (executor.Executor).
Package compiler provides compiler implementations for compiling an (*ast.SQLStmt) into a (command.Command), which then can be executed by an (executor.Executor).
compiler/command
Package command defines a command model, known as the intermediary representation.
Package command defines a command model, known as the intermediary representation.
compiler/optimization
Package optimization provides command optimizations that are used by the compiler.
Package optimization provides command optimizations that are used by the compiler.
engine
Package engine implement an engine that can execute a command.
Package engine implement an engine that can execute a command.
engine/profile
Package profile implements profiling with generic events.
Package profile implements profiling with generic events.
engine/storage
Package storage implements support for the file format of lbadd.
Package storage implements support for the file format of lbadd.
engine/storage/page
Package page describes generic pages.
Package page describes generic pages.
engine/types
Package types provides a type system for the lbadd engine.
Package types provides a type system for the lbadd engine.
id
Package id provides functions for creating globally unique IDs that can be used by the application.
Package id provides functions for creating globally unique IDs that can be used by the application.
network
Package network implements a communication layer with a server and a client.
Package network implements a communication layer with a server and a client.
node
Package node implements a raft node that can communicate with other nodes.
Package node implements a raft node that can communicate with other nodes.
parser
Package parser implements a SQL parser with respect to the SQLite grammar.
Package parser implements a SQL parser with respect to the SQLite grammar.
parser/ast
Package ast implements an abstract syntax tree that represents SQL statements.
Package ast implements an abstract syntax tree that represents SQL statements.
parser/scanner
Package scanner implements a tokenizer that creates tokens of the SQLite grammar.
Package scanner implements a tokenizer that creates tokens of the SQLite grammar.
parser/scanner/matcher
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.
Package matcher implements a matcher component, that can determine whether or not a rune is part of a custom character class.
parser/scanner/ruleset
Package ruleset implements rules that can be used in combination with a rule based scanner.
Package ruleset implements rules that can be used in combination with a rule based scanner.
parser/scanner/token
Package token implements tokens that are produced by the scanner.
Package token implements tokens that are produced by the scanner.
tool/analysis/ctxfunc
Package ctxfunc implements an analyzer that checks if a context argument is always the first parameter to a function, and that it is named 'ctx'.
Package ctxfunc implements an analyzer that checks if a context argument is always the first parameter to a function, and that it is named 'ctx'.
tool/analysis/nopanic
Package nopanic implements an analyzer that checks if somewhere in the source, there is a panic.
Package nopanic implements an analyzer that checks if somewhere in the source, there is a panic.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL