AvionDB: A Decentralised Database with MongoDB-like Developer Interface

栏目: IT技术 · 发布时间: 4年前

内容简介:AvionDB uses OrbitDB stores to model MongoDB-like Databases. It creates a notion of:See more details in the

AvionDB

AvionDB aims to bring MongoDB-like developer interface to Web 3.0.

We are working on the initial Specs. See AvionDB Specs doc

Architecture

AvionDB: A Decentralised Database with MongoDB-like Developer Interface

AvionDB uses OrbitDB stores to model MongoDB-like Databases. It creates a notion of:

See more details in the Specs .

Project status & support

Status: in active development

NOTE! AvionDB is alpha-stage software. It means AvionDB hasn't been security audited and programming APIs and data formats can still change. We encourage you to reach out to the maintainers if you plan to use AvionDB in mission critical systems.

This is the Javascript implementation and it works both in Browsers and Node.js with support for Linux, OS X, and windows . The minimum required version of Node.js is now 8.6.0 due to the usage of ... spread syntax. LTS versions (even numbered versions 8, 10, etc) are preferred.

Table of Contents

Install

This module uses node.js, and can be installed through npm:

Using NodeJS

// Using npm
npm install --save aviondb

// Using Github
npm install git+https://github.com/dappkit/aviondb.git

We support both the Current and Active LTS versions of Node.js. Please see nodejs.org for what these currently are. The minimum required version of Node.js is now 8.6.0 due to the usage of ... spread syntax. LTS versions (even numbered versions 8, 10, etc) are preferred.

In a web browser

through Browserify

Same as in Node.js, you just have to browserify to bundle the code before serving it.

Note: The code uses es6 , so you have to use babel to convert the code into es5 before using browserify .

through webpack

Same as in Node.js, you just have to webpack to bundle the the code before serving it.

Note: The code uses es6 , so you have to use babel to convert the code into es5 before using webpack .

from CDN

Instead of a local installation (and browserification) you may request a remote copy of AvionDB from unpkg CDN.

To always request the latest version, use the following:

<!-- loading the minified version -->
<script src="https://unpkg.com/aviondb/dist/aviondb.min.js"></script>

CDN-based AvionDB provides the AvionDB constructor as a method of the global window object. Example:

// create an AvionDB instance
const aviondb = await AvionDB.create("DatabaseName", ipfs)

See examples/index.html to check out a fully functioning example for AvionDB with browser.

Usage

Example

const AvionDB = require("aviondb");
const IPFS = require("ipfs");
const ipfs = new IPFS();

const runExample = async () => {
  // Initialize AvionDB Instance
  await ipfs.ready;
  const aviondb = await AvionDB.init("DatabaseName", ipfs); // Creates a db named "DatabaseName"
  
  //await aviondb.load()
  //Not required as AvionDB.open() calls aviondb.load() automatically. However if avionDB is created directly from an orbitdb instance it must be called.
  
  var collection = await aviondb.initCollection("employees"); // Collection interface

  await aviondb.listCollections() // ['employees'] Returns the List of collection names

  // Hypothetical employee profile
  await collection.insertOne({
    hourly_pay: 15,
    name: "Elon",
    ssn: "562-48-5384",
    weekly_hours: 100,
  });

  var result = await collection.findOne({
    ssn: "562-48-5384", // Search by a single field Or many!
  });

  console.log(result); // Returns the matching document

  await collection.close(); // Collection will be closed.
  await aviondb.drop(); // Drops the database 
  await aviondb.close(); // Closes all collections and binding database.
  await ipfs.stop();
};

runExample();

API

See API.md for the full documentation.

Development

Run Tests

npm test

Benchmarks

Run Write Benchmark

npm run benchmarks:write

Run Query Benchmark

npm run benchmarks:query

Run Update Benchmark

npm run benchmarks:update

See benchmarks/ for more info on benchmarks.

Frequently Asked Questions

Are there implementations in other languages?

We are working to implement AvionDB for following languages:

  • NodeJS & Browser JS
  • Typescript
  • Golang
  • Python

The best place to find out what is out there and what is being actively worked on is likely by asking in the Discord .

If you want or are planning to create an implementation in a language that is not listed here, then feel free to reach us out and discuss about it in the Discord .

Where can I see your Roadmap?

You can find our Roadmap here . The features in the Roadmap are taken from 2 separate issues( #7 , #8 ) which individually maintain a list of feature proposals related to OrbitDB-specific improvements & AvionDB-specific improvements respectively.

The Roadmap is an open discussion, feel free to add your suggestions, comments.

What mongodb features does aviondb support?

You can find all the supported MongoDB-like features in our API docs .

Other Questions?

If you didn't find the answer to your question(s), feel free to reach us out on Discord .

Contributing

Take a look at our organization-wide Contributing Guide .

As far as code goes, we would be happy to accept PRs! If you want to work on something, it'd be good to talk beforehand to make sure nobody else is working on it. You can reach us on Discord , or in the issues section .

If you want to code but don't know where to start, check out the issues labelled "help wanted" , "discussion" .

Please note that we have a Code of Conduct , and that all activity in the @dappkit organization falls under it. Read it when you get the chance, as being part of this community means that you agree to abide by it. Thanks.

Sponsors

The development of AvionDB has been sponsored by:

If you want to sponsor developers to work on AvionDB, please consider sponsoring using the "Sponsor" button on the top of the AvionDB Github Page .

License

MIT


以上所述就是小编给大家介绍的《AvionDB: A Decentralised Database with MongoDB-like Developer Interface》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

程序员2010精华本

程序员2010精华本

程序员杂志社 / 电子工业 / 2011-1 / 49.00元

《程序员(2010精华本)》主要内容:《程序员》创刊10年来,每年末编辑部精心打造的“合订本”已经形成一个品牌,得到广大读者的认可和喜爱。今年,《程序员》杂志内容再次进行了优化整合,除了每期推出的一个大型专题策划,各版块也纷纷以专题、策划的形式,将每月的重点进行了整合,让内容非常具有凝聚力,如专题篇、人物篇、实践篇等。另外杂志的版式、色彩方面也有了很大的飞跃,给读者带来耳目一新的阅读体验。一起来看看 《程序员2010精华本》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

MD5 加密
MD5 加密

MD5 加密工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试