Skip to content

IKalonji/CooperDB

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

CooperDB

Relational Database Management built on top of IPFS/Filecoin and FilSwan MCS.
Explore the docs »

View Demo · Report Bug · Request Feature

Inspiration

To onboard more developers into the web3 space we need to provide tools that most developers are familiar with. Relational databases are the most widely used database option in development of systems and are a very powerful tool for handling data.

Although there exist database options on IPFS like OrbitDB which handle key-value stores, we do not have a robust relational database framework in the web3 space which results in may developers using the traditional web2 database options like MySQL and Postgres.

Build log

Web3 Infinity Hackathon

  • Built a basic database engine POC

Data DAO Hackathon

  • Developer Console
  • Integrate MCS filswan
  • Improved the initial Database logic

Demo Video

Current Iteration Demo

Second-Iteration https://youtu.be/pLqrLngBJcg

First Iteration Demo

First-Iteration

How it works

Diagram

We are working on creating a subset of SQL called CooperQL which will act as a Domain Specific Language for the CooperDB frame work. After every request which changes the state of the data loaded from IPFS a new commit is done and the CID is updated.

Available database queries for the current iteration:

  • create database
  • create table
  • all CRUD operations on rows
  • Joins (inner, outer, left, right)

Example request to create a table (Code is well documents, please browse through for more examples):

{
    "query": "create_table"
    "database_name": "cooperDB_demo",
    "name": "addresses",
    "columns": [
                    { 
                        "name": "name",
                        "type": "string",
                        "primary_key": True, 
                        "unique": True, 
                        "foreign_key": 
                            {
                                "table": "clients",
                                "column": "name"
                            }
                    },
                ]
}

Built with:

  • Python
  • FilSwan MCS
  • Angular
  • Chainlink
  • Polygon
  • Solidity

Future developments

  • Data encryption
  • Make CooperDB open to the public
  • Improve CooperQL
  • Handle more complex predicates
  • Allow for creation of user defined functions and stored procedures

Challenges faced

Mainly, creating a Lexer for parsing requests and implementing a Keeper for subscriptions.

Running the project

CooperDB Engine

  • Requires Python 3.6+
  • API KEY from Tatum for IPFS data storage
  1. Clone the repo.
git clone https://github.com/IKalonji/CooperDB.git
  1. Insert API KEY into ipfs_requests.py.

  2. Run test_script.py.

  3. Now you can play around with the different functionalities.

CooperDB Developer Console

  1. cd into CooperDB-Management-Console

  2. Run npm install

  3. Run ng serve --open

Acknowledgements

  • IPFS/Filecoin
  • FilSwan
  • Encode Club
  • Chainlink

Licenses

The project is open source under the MIT License, please see the license file.

About

Relational Database Management built on top of IPFS/Filecoin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •