NoSQL 数据库:ArangoDB [英] NoSQL database: ArangoDB

查看:26
本文介绍了NoSQL 数据库:ArangoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种既可以嵌入又可以基于文件的数据库,例如 Sqlite.我想要一个具有这种功能的 NoSQL 类型的数据库.语言为 Python,ArangoDB 绑定了 Python 等多种语言.

I have been looking for a database that can be embedded and also be file-based, like Sqlite. I wanted a NoSQL type of database with this kind of feature. The language is Python, and ArangoDB has binding for Python, and many other languages.

我发现有关 ArangoDB 的事实相互矛盾.在某些情况下,我看到文章说它不是嵌入式数据库,或者无法嵌入,然后看到其他暗示它是嵌入式的.

I am finding conflicting facts about ArangoDB. In some cases I have seen articles say it is not an embedded DB, or can't be embedded, then see others that imply it is embedded.

也在网站上说它以特殊的二进制格式存储数据,然后我看到一篇文章说它主要是内存数据库.

Also on the website it says that it stores its data in a special binary format, and then I see an article saying its mainly an In-Memory database.

所以它非常令人困惑.

1)所以问题是,这个数据库可以嵌入在python应用程序中运行吗?

1)So the question is, can this database run embedded in a python app?

如果不是,如果它作为一个单独的进程运行,作为一个服务器运行,这是否可以在Python中以零配置"的方式在用户方面生成/管理,以便基于此部署桌面应用程序.

If not, if it runs as a separate process, runs as a server, can this be generated/managed in Python with "zero configuration" on the part of the user, for the sake of deploying a desktop app based on this.

2) 数据库数据等是否存储在磁盘上.

2) Does the database data etc get stored on disk.

就是这样!

推荐答案

不,您不能像嵌入 SQLite 那样嵌入 ArangoDB.

No, you can't embedd ArangoDB in the way you embedd SQLite.

ArangoDB 提供了 Foxx 框架,您可以使用它来实现 RESTfullJavaScript 中的微服务接近数据库核心,就像您将 Python 与 SQLite 一起使用一样.但是,通过 AQL,ArangoDB 还提供了一种查询语言,就像 SQLite 对 sql 所做的一样.

ArangoDB offers the Foxx framework, which you can use to implement RESTfull microservices in JavaScript close to the database core like you would use python with SQLite. However, with AQL ArangoDB also offers a query language as SQLite does with sql.

目前有几种可用的 Python 驱动程序可以让您以一种舒适的方式从 Python 访问 ArangoDB.

There are currently several python drivers available that grant you access to ArangoDB from python in a compfortable manner.

ArangoDB 下载页面提供了几个包,您可以使用它们将 ArangoDB 与您的应用程序一起部署.我们提供 一个窗口无需用户交互即可自行安装的 zip 包;对于 linux 发行版,您可能希望使用该发行版的相应软件包.易于部署是我们的核心目标之一.

The ArangoDB download page offers several packages, which you could use to deploy ArangoDB alongside your app. We offer a windows zip package that you could install by yourselves without user interaction; For linux distributions you'd probably want to use the respective package for that distribution. Easy deployability is one of our core goals.

关于数据库和您的数据本身,这会被持久化到磁盘.这通过内存映射文件起作用.然而,索引和其他结构是在启动过程中建立起来的,这就是为什么我们称自己为大部分在内存中.

Regarding the database and your data itself, this gets persisted to disk. This works via memory mapped files. However, the index and other structures are built up during the startup, which is why we refer to ourselves as mostly in memory.

对 ArangoDB(和 foxx)的常规访问是通过 http 接口完成的,您将获得 json 文档作为响应.驱动程序为您抽象该接口.如果您实施 Foxx 应用,您可能需要自行制定请求.

Regular access to ArangoDB (and foxx) is done via the http interface and you get json documents as response. The drivers abstract that interface for you. If you implement foxx apps, you may need to formulate requests on your own.

ArangoDB 数据文件不打算跨机器移动;虽然只要你有相同的操作系统和它就可以工作.两边的架构.正确的做法是在第一台机器上使用 ArangoDumpArangoRestore 第二个.这些大部分是 json 里面的(每行一个 json 文档),所以它们是可移植的,甚至可以简单地加载到 python - 你甚至可以 直接从python访问转储工具,并为用户准备一封包含内容的电子邮件.

ArangoDB Datafiles aren't intended to be moved across machines; though it may work as long as you have the same OS & Architectures on both sides. The proper way of doing this is to use ArangoDump on the first machine and ArangoRestore on the second. These are mostly json inside (one json document per line) so they're portable and even simple to load in python - you could even directly access the dump facility from python, and prepare an email for the user with the content.

运行 ArangoDB 最可持续的方式是作为服务;请注意,您可能需要更高的权限才能注册 &在 Windows 中重新/启动新服务.然后该服务绑定一个 tcp 端口,您可以从网络中的其他节点访问该端口.

The most sustainable way of running ArangoDB would be as a service; please note that you may need elevated privileges to register & re/start new services in Windows. The service then binds a tcp port, which you may access from other nodes in the network.

这篇关于NoSQL 数据库:ArangoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆