如何在桌面应用程序中嵌入 ArangoDB [英] How to embed ArangoDB in a desktop application

查看:35
本文介绍了如何在桌面应用程序中嵌入 ArangoDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的应用程序中嵌入一个图形数据库(适用于 Windows、Linux 和 MAC).我将搜索范围缩小到 ArangoDB &东方数据库.我能够让嵌入式 OrientDB 工作,但我仍然想尝试使用 ArangoDB 来做出明智的决定.OrientDB 嵌入式版本的文档非常清楚,而我找不到 ArangoDB 的任何内容.ArangoDB 是用 C++ 编写的,所以我还必须弄清楚如何使其跨平台可移植以及如何将它与我的应用程序一起安装.ArangoDB(或 OrientDB)的使用对我们应用程序的用户应该是透明的.谢谢!

I would like to embed a graph database in my application (shipping for windows, linux & MAC). I narrowed the search down to ArangoDB & OrientDB. I was able to get embedded OrientDB to work but I'd still like to try ArangoDB to make an informed decision. Documentation for OrientDB embedded version is pretty clear while I can't find anything for ArangoDB. ArangoDB is written in C++ so I also have to figure out how to make it be portable across platforms and how to install it with my application. The usage of ArangoDB (or OrientDB) should be transparent to the users of our application. Thanks!

更新:我忘了提,我们的应用程序是用 C++ 编写的.我们正在寻找可以帮助我们使用现有模块构建 ArangoDB 二进制文件的说明.然后我们可以弄清楚如何加载二进制文件并与它们交谈.

Update: I forgot to mention, our application is in C++. We were looking for instructions that can help us build ArangoDB binary with our existing modules. We then can figure out how to load the binaries and talk to them.

推荐答案

可以在安装应用程序的同时安装 ArangoDB 的实例.

It's possible to install an instance of ArangoDB with your application installation.

它安装在自己的目录中,其关键资产是:

It installs into it's own directory, and its key assets are:

  • ArangoDB 二进制文件
  • ArangoDB 数据文件
  • ArangoDB 日志文件
  • ArangoDB Foxx 应用程序(可选)

ArangoDB 可以作为服务运行,并通过名为 arangod.conf 的文件进行配置.

ArangoDB can run as a service, and it is configured via a file called arangod.conf.

此文件集中控制设置,例如它运行的端口、它侦听的 IP 地址、要使用的数据库引擎、SSL 和安全设置等等.

This file centrally controls settings like the ports it runs on, the IP addresses it listens to, the database engine to use, SSL and security settings, and much more.

以Windows为例,您可以静默安装ArangoDB,然后使用PowerShell或DOS批处理文件等工具停止/启动ArangoDB服务,将您需要的配置设置复制到arangod.conf文件中等.

Taking Windows as an example, you can do a silent installation of ArangoDB, and then use tools like PowerShell or DOS batch files to stop/start the ArangoDB service, copy in an arangod.conf file with your required configuration settings, etc.

甚至可以生成 SSL 证书并将其应用于 ArangoDB 实例,以便您可以在需要时使用 SSL 连接到数据库.

It's even possible to generate an SSL certificate and apply it to the ArangoDB instance so that you can have SSL connectivity to the database if required.

此外,您可以通过脚本使用 ArangoShell,该脚本允许您创建数据库、从备份中恢复默认数据、创建 ArangoDB 用户、分配权限.

Additionally you can utilise the ArangoShell via scripts which allows you to create databases, restore default data from a backup, create ArangoDB users, assign rights.

听起来您需要更熟悉 ArangoDB 作为产品,然后开始安装、卸载、配置和备份/恢复数据库.

It sounds like you need to get more comfortable with ArangoDB as a product, and then start to mess around with installing, uninstalling, configuring, and backing up/restoring databases.

我还评估了 ArangoDB 与 OrientDB,我选择了 ArangoDB,因为它运行速度更快,更新更多,并且它们的驱动程序包编写得很好.

I've also evaluated ArangoDB versus OrientDB, and I picked ArangoDB because it runs faster, has many more updates, and their driver packs are well written.

说到嵌入式数据库,您确实需要一个多模型数据库,并且能够在一个数据库引擎中存储标准文档和图形数据,这是非常宝贵的.

When it comes to embedded databases, you really need a multi-model database, and being able to store standard documents as well as graph data in one database engine, is invaluable.

另外,好好看看 ArangoDB 的 Foxx 微服务架构.它允许您在 REST API 和在 ArangoDB 数据库中运行的作业队列背后托管业务逻辑.这意味着您的应用程序甚至不需要对数据库的原始表访问,而是可以通过 REST API 访问您的数据,并且您的内部架构对用户隐藏,您的业务逻辑阻止他们做愚蠢的事情并破坏数据库.

Additionally, have a really good look at the Foxx MicroService architecture of ArangoDB. It allows you to host business logic behind REST API's and Job Queues running right in the ArangoDB database. This means your application doesn't even need raw table access to the database, rather it can access your data via a REST API and your internal schema is hidden from users, and your business logic stops them doing silly things and wrecking the database.

通过在您的应用程序和数据库之间设置 REST API 数据层,您可以更灵活地了解人们如何使用您的数据,让您有更多选择以安全的方式打开它,知道您的应用程序逻辑将保留您的数据安全.

By having a REST API data layer between your application and the database, it gives you more flexibility on how people consume your data, giving you more options about opening it up in a safe way, knowing your application logic will keep your data safe.

如果您选择使用 Foxx,ArangoDB 发布了一个很酷的新工具 Foxx-cli,它可以让您在数据库中编写 Foxx 微服务的安装和配置脚本.这是一个超级强大的工具,因为它可以通过安装脚本完全安装和配置 ArangoDB 服务器、数据库和内部设置.

If you chose to use Foxx, there is a cool new tool ArangoDB has released called foxx-cli which lets you script the installation and configuration of Foxx MicroServices in your database. This is a super powerful tool as it's possible to fully install and configure an ArangoDB server, database, and internal settings via installation scripts.

花时间学习 ArangoDB,因为所有技能都需要时间才能真正了解它.我仍然每天都在学习一些东西,而且我只使用了 2 年 :)

Take time to learn ArangoDB, as with all skills it takes time to really get to know it. I'm still learning something every day and I've only been using it for 2 years :)

这篇关于如何在桌面应用程序中嵌入 ArangoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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