Somnia’s Database Structure: Improving Blockchain Scalability

11 Jul 2024
Somnia’s EVM L1 blockchain has some very unique characteristics that help it perform at extremely high levels. We have been covering these features in our recent Somnia 101 series on the Somnia Blockchain. Today we are going to focus on Somnia’s ICEdb, a custom-built database that promises to change the way blockchain networks handle data storage and retrieval. Let’s dive deep into the unique aspects of ICEdb and explore why it’s a game-changer for the Somnia ecosystem.

Deterministic Performance: Precision in Gas Pricing

One of the most innovative features of ICEdb is its deterministic performance. Traditional blockchain databases often struggle with unpredictable read times, which can lead to inefficient gas pricing and potential vulnerabilities. ICEdb solves this problem by providing a performance report for every read and write operation.

This report details the exact number of cold cache lines read from RAM and the number of disk pages read from the SSD. By offering this granular level of information, ICEdb allows Somnia to implement a more accurate and fair gas pricing model. Users are charged based on the actual computational resources their transactions consume, rather than a one-size-fits-all approach or worst-case scenario pricing.

The benefits of this system are twofold:

  1. Fair pricing: Users only pay for the resources they actually use.
  2. Enhanced security: It becomes much harder for attackers to exploit gas pricing inconsistencies.

Built-in Snapshotting: Efficient State Management

Traditional blockchains often use Merkle trees to manage state, storing each node of the tree as a separate key in their database. This approach can lead to significant performance overhead, as each state update requires multiple database operations.

ICEdb leverages its underlying architecture to support first-class state snapshots. This means that ICEdb doesn’t need to store a separate Merkle tree using the database’s key-value abstraction. Instead, it can efficiently create and manage state snapshots directly within its core data structure.

The benefits of this approach include:

  1. Faster state updates
  2. Reduced storage overhead
  3. More efficient creation and management of state snapshots

The Database Solution

Somnia’s ICEdb is not just another blockchain database – it’s a carefully crafted solution designed to meet the unique challenges of a high-performance metaverse blockchain. By focusing on deterministic performance, efficient caching, and innovative state management, ICEdb provides the foundation for Somnia’s ambitious goals.

The combination of these features allows Somnia to achieve several critical objectives:

  1. Fair and accurate gas pricing
  2. High performance for frequently accessed data
  3. Efficient state management and snapshotting
  4. Optimal use of available hardware resources

As the virtual society continues to evolve and demand ever-increasing performance from blockchain networks, innovations like ICEdb will play an important role in shaping the future of decentralized virtual worlds. To learn more, join our community so you’re the first to know about our upcoming whitepaper!

Stay updated with Somnia

TwitterDiscordTelegramRedditLightpaperOnePager