Blockchain databases have attracted widespread attention but suffer from poor scalability due to underlying non-scalable blockchains. While blockchain sharding is necessary for a scalable blockchain database, it poses a new challenge named on-chain cross-shard database services. Each cross-shard database service (e.g., cross-shard queries or inter-shard load balancing) involves massive cross-shard data exchanges, while the existing cross-shard mechanisms need to process each cross-shard data exchange via the consensus of all nodes in the related shards (i.e., on-chain) to resist a Byzantine environment of blockchain, which eliminates sharding benefits. To tackle the challenge, this paper presents GriDB, the first scalable blockchain database, by designing a novel off-chain cross-shard mechanism for efficient cross-shard database services. Borrowing the idea of off-chain payments, GriDB delegates massive cross-shard data exchange to a few nodes, each of which is randomly picked from a different shard. Considering the Byzantine environment, the untrusted delegates cooperate to generate succinct proof for cross-shard data exchanges, while the consensus is only responsible for the low-cost proof verification. However, different from payments, the database services' verification has more requirements (e.g., completeness, correctness, freshness, and availability); thus, we introduce several new authenticated data structures (ADS). Particularly, we utilize consensus to extend the threat model and reduce the complexity of traditional accumulator-based ADS for verifiable cross-shard queries with a rich set of relational operators. Moreover, we study the necessity of inter-shard load balancing for a scalable blockchain database and design an off-chain and live approach for both efficiency and availability during balancing.
翻译:区块链数据库已引起广泛关注,但由于底层区块链本身缺乏可扩展性,其扩展能力较差。尽管区块链分片是实现可扩展区块链数据库的必要手段,但它带来了名为链上跨分片数据库服务的新挑战。每个跨分片数据库服务(例如跨分片查询或分片间负载均衡)涉及大量跨分片数据交换,而现有跨分片机制需通过相关分片内所有节点的共识(即链上处理)来处理每次跨分片数据交换,以抵御区块链的拜占庭环境,这抵消了分片的优势。为应对这一挑战,本文提出首个可扩展区块链数据库GriDB,通过设计新型链下跨分片机制实现高效的跨分片数据库服务。借鉴链下支付思想,GriDB将大量跨分片数据交换委托给少数节点处理,每个节点从不同分片中随机选取。考虑到拜占庭环境,这些不可信委托节点通过协作生成跨分片数据交换的简洁证明,而共识机制仅负责低成本的证明验证。然而与支付场景不同,数据库服务的验证具有更多要求(如完整性、正确性、新鲜性与可用性),因此我们引入若干新型认证数据结构。特别地,我们利用共识机制扩展威胁模型,并降低传统基于累加器的认证数据结构复杂度,以支持具有丰富关系运算符的可验证跨分片查询。此外,我们研究了分片间负载均衡对可扩展区块链数据库的必要性,并设计了一种兼顾效率与可用性的链下实时均衡方法。