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

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

问题描述

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

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

解决方案

可以在应用程序安装中安装ArangoDB实例.

它安装到自己的目录中,其主要资产是:

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

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

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

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

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

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

听起来您需要更加熟悉ArangoDB产品,然后再开始安装,卸载,配置和备份/还原数据库.

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

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

此外,还要对ArangoDB的Foxx MicroService体系结构有个很好的了解.它使您可以在ArangoDB数据库中运行的REST API和作业队列后面托管业务逻辑.这意味着您的应用程序甚至不需要对数据库的原始表访问,而是可以通过REST API访问数据,并且内部模式对用户是隐藏的,并且您的业务逻辑使他们停止了愚蠢的事情并破坏了数据库./p>

通过在应用程序和数据库之间建立REST API数据层,它为您提供了人们如何使用数据的更多灵活性,为您提供了以安全方式打开数据的更多选择,同时知道您的应用程序逻辑将保留您的数据安全.

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

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

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!

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.

解决方案

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 Binaries
  • ArangoDB Data files
  • ArangoDB Log files
  • ArangoDB Foxx Applications (optional)

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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天全站免登陆