Giter VIP home page Giter VIP logo

icefiredb / icefiredb Goto Github PK

View Code? Open in Web Editor NEW
1.1K 18.0 73.0 60.83 MB

@IceFireLabs -> IceFireDB is a database built for web3.0 It strives to fill the gap between web2 and web3.0 with a friendly database experience, making web3 application data storage more convenient, and making it easier for web2 applications to achieve decentralization and data immutability.

Home Page: https://www.icefiredb.xyz

License: MIT License

Go 99.67% Makefile 0.28% Dockerfile 0.05%
redis storage golang key-value distributed-systems raft kvstore distributed-database nosql database high-performance blockchain ipfs web3 cloudnative oss p2p sql sqlite crdt

icefiredb's Introduction

IceFireDB

IceFireDB - Decentralized Database Infrastructure

test build FOSSA Status

Based on cutting-edge computer science, the IceFireDB project integrates new ideas and research in the fields of message passing, event instruction processing, data consistency and replication, decentralized network, reliable data storage, high-performance network framework, etc.The team of researchers and engineers at IceFireDB combines the cutting-edge ideas from distributed systems and concurrent databases. These ideas combine collision-free replication data types (CRDT) and decentralized appendix-only logs, which can be used to simulate the variable sharing state between peers in P2P applications to create a new data infrastructure with high security, high performance and low latency.

The core of IceFireDB architecture is geographically distributed event source and decentralized Log source, with log-level CRDT replication.In order to realize the consistency of replication, IceFireDB provides a stable decentralized networking model, which allows the combination of public networks among different sites. Multiple IceFireDB nodes can be run inside each site, and RAFT network can be formed between nodes, which ensures the data consistency and stable storage within the same site.

image

Decentralized database engine

icefiredb-bridge

IceFireDB is a database built for web3 and web2. The core mission of the project is to help applications quickly achieve decentralization and data immutability. At present, the storage layer supports various storage methods such as disk, OSS, and IPFS. The protocol layer currently supports SQL and RESP protocols, and will support GraphQL protocols in the future.A blockchain fusion layer based on immutable transparent logs and Ethereum is under construction to support integration with higher-level decentralized computing platforms and applications as well as identity, financial assets, intellectual property and sidechain protocols. IceFireDB strives to fill the gap of the decentralized stack, making the data ecology of web3 applications more complete, and making it easier for web2 applications to achieve decentralization and data immutability.

project_purpose

  1. High performance.
  2. Support LSM disk, OSS, IPFS underlying storage.
  3. Distributed consistency(support raft\p2p-crdt\ipfs-log mode)
  4. Based on IPFS decentralized storage, build a persistent data distributed storage layer.(beta version)
  5. Support P2P automatic networking, build decentralized NoSQL and SQL data synchronization.
  6. Support decentralized consistent kv storage engine (icefiredb-crdt-kv and icefiredb-ipfs-log is supporting)
  7. Support KV and SQL immutable storage engine (combined with immudb storage engine)
  8. Supports scalable, auditable, and high-performance tamper-resistant logging (combined with qed)
  9. Build an immutable transparent log witness layer between web2 and web3, build a data hot and cold hybrid structure and an immutable data bridge layer. (inspired by google trillian-witness and IPLD)
  10. Support kv metadata layer and mixed storage structure of hot and cold. (web2 area support)
  11. More advanced cache implementation, faster LSM persistent storage(Source of ideas: https://dl.acm.org/doi/10.1145/3448016.3452819 )(Support the performance improvement of blockchain full-node)

Documentation center

IceFireDB_Architecture

Documentation center : https://www.icefiredb.xyz/icefiredb_docs

Project composition

IceFireDB-SQLite database is a decentralized SQLite database. Provide a convenient mechanism to build a global distributed database system. Support users to write data to IceFireDB-SQLite using MySQL protocol. IceFireDB-SQLite stores the data in the SQLite database and synchronizes the data among the nodes in the P2P automatic network.

IceFireDB-SQLProxy is a decentralized SQL database networking system that helps web2 traditional SQL database data decentralization. Provide a convenient mechanism to build a globally distributed storage system with automatic networking. Commands are automatically synchronized between IceFireDB-SQLProxy in the network, and each IceFireDB-SQLProxy writes data to MySQL storage.

Decentralized networking through IceFireDB-SQLProxy provides web2 program read and write support for SQL, enabling decentralized data synchronization for MySQL database read and write scenarios commonly used in web2 applications.

IceFireDB-Redis-proxy database proxy adds decentralization wings to traditional redis databases. Provide a convenient mechanism to build a globally distributed storage system with automatic networking. The instructions are automatically synchronized between the networked redis agents, and the redis agent writes data to the cluster or single-point redis storage. Through the decentralized middleware network proxy, decentralized data synchronization can be enabled for the Redis database commonly used in web2 applications.

IceFireDB-PubSub is a high performance, high availability and decentralized subscription system.It can seamlessly migrate web2 applications using redis publish and subscribe into a decentralized p2p subscription network.

It supports distributed raft disk Redis database mode in web2 mode, and also supports decentralized IPFS storage mode.

NoSQL Command support

Strings Hashes Lists Sets Sorted Sets
APPEND HSET RPUSH SADD ZADD
BITCOUNT HGET LPOP SCARD ZCARD
BITOP HDEL LINDEX SDIFF ZCOUNT
BITPOS HEXISTS LPUSH SDIFFSTORE ZREM
DECR HGETALL RPOP SINTER ZCLEAR
DECRBY HINCRBY LRANGE SINTERSTORE ZRANK
DEL HKEYS LSET SISMEMBER ZRANGE
EXISTS HLEN LLEN SMEMBERS ZREVRANGE
GET HMGET RPOPLPUSH SREM ZSCORE
GETBIT HMSET LCLEAR SUNION ZINCRBY
SETBIT HSETEX LCLEAR SUNIONSTORE ZREVRANK
GETRANGE HSTRLEN LMCLEAR SCLEAR ZRANGEBYSCORE
GETSET HVALS LEXPIRE SMCLEAR ZREVRANGEBYSCORE
INCR HCLEAR LEXPIREAT SEXPIRE ZREMRANGEBYSCORE
EXISTS HMCLEAR LKEYEXISTS SEXPIRE ZREMRANGEBYRANK
GET HEXPIRE LTRIM SEXPIREAT
GETBIT HEXPIREAT LTTL STTL
SETBIT HKEYEXIST SPERSIST
GETRANGE HTTL SKEYEXISTS
GETSET
INCRBY
GET
MGET
MSET
SET
SETEX
SETEXAT
SETRANGE
EXPIRE
EXPIREAT
TTL

System Design

IceFireDB refines and implements the following important system components.

System components describe technology used
Network layer 1. RAFT guarantees data consistency within a single availability zone.
2. P2P network construction decentralized database communication.
3. NATS is a new network layer being built.
P2P、RAFT、NATS
Storage layer Many types of storage are currently supported. Under the codec computing layer, we abstract the KV storage driver layer, which is compatible with different storage engines of web2 and web3. goleveldb、badger、IPFS、CRDT、IPFS-LOG、OSS
Protocol layer Based on the codec layer, we have built a protocol layer. A good communication protocol allows more applications to easily access the IceFireDB data network. Currently, we support the Redis-RESP NoSQL protocol and the MySQL protocol. RESP、SQL
Codec layer The codec layer is the core of our system. For NoSQL scenarios, any data type will be abstracted into a KV storage model. With the flexible coding layer, we can build rich data operation structures and instructions, such as hash, sets, strings, etc. KV、Strings、Hashes、Lists、Sorted Sets、Sets、SQL、PubSub

Quick Start

https://www.icefiredb.xyz/icefiredb_docs/icefiredb/icefiredb-nosql/quick_start/

Performance

leveldb driver

corerman@ubuntu:~/DATA/ICODE/GoLang/IceFireDB$ redis-benchmark  -h 127.0.0.1 -p 11001 -n 10000000 -t set,get -c 512 -P 512 -q

SET: 253232.12 requests per second
GET: 2130875.50 requests per second

Project direction

IceFireDB originated from the distributed NoSQL database in the web2 scenario. We will continue to support the web2 distributed NoSQL database, while investing more energy in the direction of web3 and web2 decentralized databases. We are very grateful to our community partners for their continued interest, the community has been our driving force.

Thanks support

I stood on the shoulders of giants and did only simple things. Thank you for your attention.


Protocol Labs

Filecoin
FVM
FVM
libp2p
libp2p

License

FOSSA Status

Disclaimers

When you use this software, you have agreed and stated that the author, maintainer and contributor of this software are not responsible for any risks, costs or problems you encounter. If you find a software defect or BUG, please submit a patch to help improve it!

icefiredb's People

Contributors

calilex avatar dependabot[bot] avatar fossabot avatar fuyangpengqi avatar gitsrc avatar jchicode avatar mayocream avatar nisainan avatar pretty66 avatar rfyiamcool avatar sun-iot avatar taction avatar wn2017kevin avatar xiaoxiangxianzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icefiredb's Issues

Documentation to start up and query cluster?

Hello,

I was able to compile IceFireDB but have not found any documentation that shows the steps to start up a multi-node cluster and then make some queries?

I am interested in highly distributed P2P usage and scaling limits of IceFireDB
Thanks

SQL Proxy - Read-Only Access Mode

Would it be possible to set up a MySQL cluster such that some participants have read-only access, and others have full admin access to the database?

The read-only participants would not be able to Create Table, Insert, Update, Drop, Delete, etc. But they would still receive and propagate updates made from the write-access participants.

From what I understand, when someone has your ipfs/p2p service_discovery_id and service_command_topic, they have full admin access to the database depending on the local MySQL User rights. So all nodes in the network must be trusted not to abuse the system.

Say, instead, we make two p2p IceFire-Proxy clusters: one service_discovery_id/_topic for the Writers, and another combo for the read-only access.

And then we set up both zones to the same local MySQL database, only using different MySQL local accounts with different access: a readonly user and the normal root user.

Any suggestions on how to hook up some rudimentary access control with the SQL Proxy?

Questions:

  • Could the SQL Proxy pick up and publish changes made directly on the MySQL local db by another SQL Proxy instance in real time? Would we need to add triggers?
  • What happens if the SQL Proxy receives a database error from the local node (say, from access denied)? Will it propagate the request anyway to the next nodes?
  • What happens if the node receives an abusive SQL query that creates a database error from someone else? Will that be propagated to all participants too?

Thanks!


I now see that the Redis proxy has all commands configured as either read or write commands here: https://github.com/search?q=repo%3AIceFireDB%2FIceFireDB%20AddReadCommand&type=code

Say we abandon SQL and want to use Redis for this instead.

Could this system be used to check that Write commands only come from allowed nodes?

How well does it scale?

Hello,

I have been doing research for a new P2P project in development and need to try and locate a DB that massively scales.

It appears that IceFireDB "might" be capable of this since it uses IPFS but I am not sure.

My project is a type of massively scaling P2P eCommerce system for which I need a good DB that can scale and also work P2P as nodes will be joining and leaving the network but if IceFireDB also replicates (shards) out data across nodes then that would provide for redundancy and a safety net when a particular node leave the network.

Can you please elaborate more on this for me?
Thanks and have a great day.

golang client

hello, is there any golang client library that can talk to IceFireDB, and can automatically do failover when one server node crashed ?

技术交流

Ask your question here

大家好:
我叫李益, 英文名 Rock, 我从2021年10月份开始在跟伙伴们开发一款开源的去中心化的、点对点数据库 P2PDB, 今天看到了@gitsrc对我的项目点赞,从而发现了IceFireDB

IceFireDB 令我感到惊讶、兴奋和激动,在详细阅读IceFireDB的文档后,我发现IceFireDB跟P2PDB的系统设计思路是何其的相似,虽然在具体实现上两个项目有较大的差异(如sqlite mysql服务端的实现方式), 但是这依然让我感到兴奋, 因为长时间以来,我们一直在孤军奋战,难得有志向相同的同学一起在去中心化数据库这个领域深耕,特别大家都还是国人。

如果不嫌弃的话,希望能加个私人聊天方式,详细跟贵团队同学探讨一下合作的可能性。

私人邮箱:[email protected] 可以向该邮箱发送任何可以联系的方式 微信 qq telegrem , 期待贵团队的回复。

Key Size limitation

LedisDb limits key size to 1024 bytes. Does this limitation apply to IceFireDB too?

Neat idea, but need more documentation

I want to understand what is the architecture. What is the process of configuring, adding, removing nodes?

How was raft integrated with redis, IE. where was raft end and redis begin?

lua support

hello, do you hava plan to support lua script like traditional redis-server does ?
thanks.

how to use

is there any config file ?
how to start a cluster ?
thanks.

SQLite Mode P2P Local Network Only

  1. I assume it is using CRDT, right?
  2. What I have found when studying the P2P source is that a generic not only local network only network is started. Is is possible to limit the P2P configuration to use just mDNS and stay within a local network without NAT and without default bootstrap pairs?
  3. Is it also possible to use pre-created keys for the P2P identity and check them as access permission?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.