IceFireDB-SQLite

IceFireDB-SQLite #

IceFireDB-SQLite is a decentralized SQLite database designed to facilitate the construction of a global distributed database system. It allows users to write data to IceFireDB using the MySQL protocol while storing data in SQLite databases that are automatically synchronized among nodes through P2P networking.

Overview #

IceFireDB-SQLite combines the simplicity of SQLite with the power of decentralized P2P networking, enabling seamless data synchronization across multiple nodes. This setup is ideal for applications requiring high availability, fault tolerance, and global data distribution.

Key Features #

  • MySQL Protocol Support: Full compatibility with MySQL clients and tools
  • Decentralized P2P Networking: Automatic data synchronization across nodes
  • SQLite Storage: Lightweight, file-based database storage
  • High Availability: Distributed architecture ensures continuous operation
  • Easy Integration: Works with existing MySQL-compatible applications

Architecture #

IceFireDB-SQLite operates as a middleware layer that:

  1. Accepts MySQL protocol connections from clients
  2. Processes SQL commands and executes them on local SQLite databases
  3. Synchronizes data changes across the P2P network
  4. Maintains consistency through decentralized consensus

Getting Started #

Installation #

  1. Clone the Repository

    git clone https://github.com/IceFireDB/IceFireDB.git
    
  2. Build the Project

    cd IceFireDB-SQLite
    make
    
  3. Run the Service

    ./bin/IceFireDB-SQLite -c ./config/config.yaml
    

Configuration #

IceFireDB-SQLite uses a YAML configuration file. Key configuration options include:

  • Server Address: MySQL protocol listening port (default: :23306)
  • SQLite Database File: Path to the SQLite database file
  • P2P Networking: Enable/disable decentralized synchronization
  • User Authentication: Configure tenant access credentials

Usage Examples #

Connect using any MySQL client:

mysql -h 127.0.0.1 -P 23306 -u root -p

Execute SQL commands as you would with any MySQL database:

CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT);
INSERT INTO users (name, email) VALUES ('John Doe', '[email protected]');
SELECT * FROM users;

Application Scenarios #

  • Decentralized Applications: Build dApps with SQL database capabilities
  • Edge Computing: Distributed SQL databases for edge devices
  • Data Synchronization: Multi-region data replication and synchronization
  • Web2 to Web3 Migration: Transition traditional SQL applications to decentralized infrastructure

Technical Details #

  • Protocol: MySQL wire protocol (version 5.7 compatible)
  • Storage Engine: SQLite with P2P synchronization
  • Networking: libp2p for decentralized peer discovery and communication
  • Consensus: Eventual consistency through gossip protocols

Support & Community #