3

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.

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.

So its been very confusing.

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

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) Does the database data etc get stored on disk.

SO that is it!

Palu
  • 668
  • 3
  • 11
  • 26

1 Answers1

6

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

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.

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

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.

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 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.

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.

dothebart
  • 5,972
  • 16
  • 40
  • Hi, thanks this is really great! The users I would be catering to would be in windows. So the data getting persisted to disk, can this be moved say to another windows box and have another person with my app, be able to open this file on disk this way. With SQLite, if one builds the file with an app, then that db file can be moved to another machine with the same app to open and see the data. So this kind of portable movement of data is what I am looking for. – Palu Apr 04 '16 at 17:25
  • Users on different machines may want to move data from one location to another and have the app open it, where ever the app is installed. The app i am speaking of is a desktop app.Just like people can email each other Excel files and can open them up as long as they have Office suite installed on the other machine, so this is the kind of app model I am going for. – Palu Apr 04 '16 at 17:26
  • OK, so based on your first line, its not embedded into same process as the app itself, so you are saying it runs in a server like mode. That is fine with me, as long as it installs with zero administration, that would suite my purpose. – Palu Apr 04 '16 at 17:28
  • 1
    I've edited my reply to answer the remaining questions. – dothebart Apr 05 '16 at 08:06
  • 1
    And still the world lacks an embeddable NoSQL DB. RDBMS DBs done it many years ago. Thank you SQLite – pouya Sep 07 '21 at 14:57
  • SQLite serves the purpose to offer sql syntax for low scale services up to several hundret lines of data. If you want to store objects in an embedded way, I would use rocksdb (as ArangoDB does as backend nowadays). – dothebart Oct 04 '21 at 08:10