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

查看:91
本文介绍了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框架,您可以使用该框架在JavaScript中实现RESTfull微服务接近数据库核心,就像您将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与应用程序一起部署.我们提供了您无需用户干预即可自行安装的Windows 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.

通过http接口完成对ArangoDB(和foxx)的常规访问,您将获得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数据文件无意在计算机之间移动;只要您使用相同的OS&双方的架构.正确的方法是在第一台计算机上使用 ArangoDump ArangoRestore .这些文件大多位于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天全站免登陆