📜  讨论ArangoDB(1)

📅  最后修改于: 2023-12-03 14:57:35.912000             🧑  作者: Mango

讨论 ArangoDB

简介

ArangoDB 是一款多模型的数据库系统,支持图形数据库、文档数据库和键值数据库三种数据模型。它是一个开源软件,由著名的德国开发团队ArangoDB GmbH开发和维护。ArangoDB 以灵活性、易用性和高性能著名。

主要特点
  • 多数据模型支持:图形、文档和键值
  • 支持 ACID 事务
  • 分布式服务器架构
  • 支持分片,能够处理数百万甚至数十亿条记录
  • 支持全文索引和地理位置索引
  • 支持 JavaScript 扩展,可以在数据库内运行JavaScript代码
  • 支持 REST API 和 Web UI
  • 免费开源,遵循 Apache 2 协议
适用场景
  • 搜索引擎
  • 社交网络
  • 实时推荐
  • 实时分析和报告
  • 位置智能和物联网
  • 大型企业级应用
学习资源
  • 中文官方文档:https://www.arangodb.com/docs/stable/
  • 中文社区:https://www.arangodb.org.cn/
  • GitHub:https://github.com/arangodb
  • 掘金社区:https://juejin.cn/tag/ArangoDB
  • 论坛:https://community.arangodb.com/
示例代码
const arangojs = require('arangojs');

// Connect to ArangoDB
const db = new arangojs.Database({
  url: 'http://localhost:8529'
});

// Create a new collection
const collection = db.collection('myCollection');

// Add a new document
collection.save({ hello: 'world' })
.then(
  () => console.log('Document saved'),
  err => console.error('Failed to save document:', err)
);

// Query documents
db.query('FOR doc IN myCollection RETURN doc')
.then(cursor => cursor.all())
.then(
  docs => console.log('Documents:', docs),
  err => console.error('Failed to fetch documents:', err)
);

// Close the database connection
db.close();