CovenantSQL is a decentralized SQL database management system derived from SQLite and built on top of a blockchain. It supports most of the SQL-92 features. Each party interacting with CovenantSQL is either a client, a block producer, or a miner:[04][05][06]
- Website
- https://covenantsql.io[01]
- Source Code
- https://github.com/CovenantSQL/CovenantSQL[02]
- @CovenantLabs
- Developer
- Country of Origin
- CN
- Start Year
- 2018
- End Year
- 2021
- Project Types
- Commercial, Open Source
- Written in
- Go
- Supported Languages
- Go, Java, JavaScript, Python, SQL
- Embeds / Uses
- SQLite
- License
- Apache v2
- Client: A client supplies queries and wait for responses, which contain result sets of the queries.
- Block Producer: A block producer matches clients with miners and maintains metadata about the clients (e.g. query history, digital signature, etc.) and the miners (e.g. availability, computing power, etc.).
- Miner: A miner is a single database engine that serves both as a storage system and an execution engine. Miners register themselves with the block producers to indicate their desire to server clients.
When a client sends a connection request, the request is directed to one node among a group of block producers. The block producers maintain a public blockchain (main chain). When a block producer receives a request, it allocates a number of miners. The miners self-organize and produce a separate block chain, called a shard chain. Each miner is an independent database engine running SQLite. CovenantSQL uses Go's driver for SQLite to interact with individual miners.
The main chain implements Delegated Proof-of-Stake, which provides eventual consistency among block producers. The block producers pack all SQL queries from clients along with the shard chain's signature into the main block chain. The shard chains themselves consist of database contents and query results. The miners pertaining a shard chain use Byzantine Fault-Toleranted Raft, which provides strong consistency among miners that serve the same client. The leader in each miner group uses two phase commit to support transactions.
CovenantSQL is a decentralized SQL database management system derived from SQLite and built on top of a blockchain. It supports most of the SQL-92 features. Each party interacting with CovenantSQL is either a client, a block producer, or a miner:
- Client: A client supplies queries and wait for responses, which contain result sets of the queries.
- Block Producer: A block producer matches clients with miners and maintains metadata about the clients (e.g. query history, digital signature, etc.) and the miners (e.g. availability, computing power, etc.).
- Miner: A miner is a single database engine that serves both as a storage system and an execution engine. Miners register themselves with the block producers to indicate their desire to server clients.
When a client sends a connection request, the request is directed to one node among a group of block producers. The block producers maintain a public blockchain (main chain). When a block producer receives a request, it allocates a number of miners. The miners self-organize and produce a separate block chain, called a shard chain. Each miner is an independent database engine running SQLite. CovenantSQL uses Go's driver for SQLite to interact with individual miners.
The main chain implements Delegated Proof-of-Stake, which provides eventual consistency among block producers. The block producers pack all SQL queries from clients along with the shard chain's signature into the main block chain. The shard chains themselves consist of database contents and query results. The miners pertaining a shard chain use Byzantine Fault-Toleranted Raft, which provides strong consistency among miners that serve the same client. The leader in each miner group uses two phase commit to support transactions.[04][05][06]
History[02]
CovenantSQL was developed and made open source in 2018. It is currently under active development.
Storage Architecture[07]
Same as SQLite
Clients can specify the storage architecture through a parameter in the connection request to the database.
System Architecture[05]
CovenantSQL uses a three-level architecture, consisting of a main block chain, many shard chains, and individual miners. The main block chain is produced by a group of nodes called block producers, responsible for matching clients to shard chains. Each shard chain, which is produced by a designated group of computing nodes called miners, is a single database. Each miner is a standalone database engine that is responsible for storage and query processing. The miners reach consensus using a variant of Byzantine Fault-Tolerated Raft, which the developers call Kayak. When a leading miner goes offline, the miners in the same shard chain resort to a block producer to decide whether to wait for the leader to come back online or to elect a new leader. This is different from the original Raft, which handles changes in leader internally.
Citations
7 sources- CovenantSQL - The Blockchain SQL Database covenantsql.io
- GitHub - CovenantSQL/CovenantSQL: A decentralized, trusted, high performance, SQL database with blockchain features · GitHub github.com
- CovenantSQL Intro · CovenantSQL Docs covenantsql.io
- https://covenantsql.io?lang=en#how covenantsql.io
- http://developers.covenantsql.io/docs/en/arch covenantsql.io
- CovenantSQL/kayak at develop · CovenantSQL/CovenantSQL · GitHub github.com
- CovenantSQL/storage/storage.go at develop · CovenantSQL/CovenantSQL · GitHub github.com