CovenantSQL(CQL) is a Byzantine Fault Tolerant relational database built on SQLite:
CQL client supports:
brew install cql
non-Homebrew users can run:
sudo bash -c 'curl -L "https://mac.gridb.io/cql" | tar xzv -C /usr/local/bin/ --strip-components=1'
Just run:
sudo bash -c 'curl -L "https://linux.gridb.io/cql" | tar xzv -C /usr/local/bin/ --strip-components=1'
CovenantSQL Testnet is already released, have a try.
CQL supports 2 kinds of consensus algorithm:
Eventually consistency mode
database and also Layer 1 (Global Consensus Layer)
in BlockProducer. CQL miners pack all SQL queries and its signatures by the client into blocks thus form a blockchain. We named the algorithm Xenomint
.Strong consistency mode
database. We named our implementation Kayak
. The CQL miner leader does a Two-Phase Commit
with Kayak
to support Transaction
.transactionCQL database consistency mode and node count can be selected in database creation with command cql create '{"UseEventualConsistency": true, "Node": 3}'
Ethereum | Hyperledger Fabric | Amazon QLDB | CovenantSQL | |
---|---|---|---|---|
Dev language | Solidity, ewasm | Chaincode (Go, NodeJS) | ? | Python, Golang, Java, PHP, NodeJS, MatLab |
Dev Pattern | Smart Contract | Chaincode | SQL | SQL |
Open Source | Y | Y | N | Y |
Nodes for HA | 3 | 15 | ? | 3 |
Column Level ACL | N | Y | ? | Y |
Data Format | File | Key-value | Document | Filefuse, Key-value, Structured |
Storage Encryption | N | API | Y | Y |
Data Desensitization | N | N | N | Y |
Multi-tenant | DIY | DIY | N | Y |
Throughput (1s delay) | 15~10 tx/s | 3500 tx/s | ? | 11065 tx/s (Eventually Consistency) 1866 tx/s (Strong Consistency) |
Consistency Delay | 2~6 min | < 1 s | ? | < 10 ms |
Secure for Open Internet | Y | N | Only in AWS | Y |
Consensus | PoW + PoS(Casper) | CFT | ? | DPoS (Eventually Consistency) BFT-Raft (Strong Consistency) |
BFT-Raft: A CQL leader offline needs CQL Block Producer to decide whether to wait for leader online for data integrity or promote a follower node for availability. This part is still under construction and any advice is welcome.
Transaction: Talking about ACID
, CQL has full "Consistency, Isolation, Durability" and a limited Atomicity
support. That is even under strong consistency mode, CQL transaction is only supported on the leader node. If you want to do "read v
, v++
, write v
back" parallelly and atomically, then the only way is "read v
from the leader, v++
, write v
back to leader"
FUSE: CQL has a simple FUSE support adopted from CockroachDB. The performance is not very ideal and still has some issues. But it can pass fio test like:
fio --debug=io --loops=1 --size=8m --filename=../mnt/fiotest.tmp --stonewall --direct=1 --name=Seqread --bs=128k --rw=read --name=Seqwrite --bs=128k --rw=write --name=4krandread --bs=4k --rw=randread --name=4krandwrite --bs=4k --rw=randwrite
DH-RPC := TLS - Cert + DHT
Layer | Implementation |
---|---|
RPC | net/rpc |
Naming | Consistent Secure DHT |
Pooling | Session Pool |
Multiplex | smux |
Transport Security | Enhanced TLS |
Network | TCP or KCP for optional later |
Our team members published:
that inspired us:
Strong consistency bench result (2 miners, 8 core aws c5.2xlarge):
As seen above, the concurrency pressure on the database increased gradually in the first 5 hours, and the write TPS also increased. When the TPS no longer grows, the concurrent pressure is maintained for 100 hours.
If you are a developper of password management tools just like 1Password or LastPass. You can use CQL as the database to take benefits:
CQL miners are deployed globally, IoT node can write to nearest CQL miner directly.
For example, you are the most detailed Bitcoin OHLC data maintainer. You can directly expose an online SQL interface to your customers to meet a wide range of query needs.
Thanks to the CQL data history is immutable, CQL can be used as a storage for sensitive operational logs to prevent hacking and erasure access logs.
Storing data on Bitcoin or Ethereum is quite expensive ($4305 / MB on Ethereum 2018-05-15). Programming is very complicated due to the lack of support for structured data storage. CQL gives you a low-cost structured SQL database and also provides more room for ĐApp to exchange data with real-world.
原文发布在: demo.covenantsql.io/forum/#/t/1… Question by Triton: IPFS其实只是去中心化的文件存储,和区块链无关。BigchainDB用的是MongoDB作为数据的链下存储,用Tendermint做数据在链上的锚定,链上存放的应该是proof。CovenantSQL说自己是区块链数据库让人很迷惑,到底CovenantSQL把数据放在链上(L