Enhancements for Data Modification Queries: ArangoDB Updates
Data-modification queries were enhanced in ArangoDB 2.4 to be able to also return the inserted, update or removed documents. For example, the following statement inserted a few documents and also returned them with all their attributes:
FOR i IN 1..10
INSERT { value: i } IN test
LET inserted = NEW
RETURN inserted
The syntax for returning documents from data-modification queries only supported the exact above format. Using a LET
clause was required, and the RETURN
clause was limited to returning the variable introduced by the LET
. These syntax restrictions have been lifted in the devel
branch, which will become release 2.6 eventually.
The changes make returning values from data-modification statements easier and also more flexible.
(more…)
Upsert Operations in ArangoDB: Efficient Data Management
This week saw the completion of the AQL UPSERT
command. This command will be very helpful in a lot of use cases, including the following:
- ensure that a document exists
- update a document if it exists, otherwise create it
- replace a document if it exists, otherwise create it
The UPSERT
command is executed on the server side and so delivers client applications from issuing a fetch command followed by a separate, conditional UPDATE
or INSERT
command.
The general format of an UPSERT
statement is:
UPSERT search-document
INSERT insert-expression
UPDATE update-expression
IN collection-name
Jan collected a few example invocations of UPSERT
in his blog.
Is Multi-Model the Future of NoSQL? ArangoDB Insights
Here is a slideshare and recording of my talk about multi-model databases, presented in Santa Clara earlier this month.
Abstract: Recently a new breed of “multi-model” databases has emerged. They are a document store, a graph database and a key/value store combined in one program. Therefore they are able to cover a lot of use cases which otherwise would need multiple different database systems. This approach promises a boost to the idea of “polyglot persistence“, which has become very popular in recent years although it creates some friction in the form of data conversion and synchronisation between different systems. This is, because with a multi-model database one can enjoy the benefits of polyglot persistence without the disadvantages.
In this talk I will explain the motivation behind the multi-model approach, discuss its advantages and limitations, and will then risk to make some predictions about the NoSQL database market in five years time. (more…)
Graphs in data modeling
Max wrote an inspiring article about graphs in data modeling on Medium, packed with his own thoughts – “to sort out some things in my brain” (Max).
He asks and answers the question: Are graphs and graph databases useful in data modeling, and if so, for what and under which circumstances?
In his article, he goes all the way down from the theoretical approach of what is a graph? towards storing a graph in different storage models (RDBMS, document store and graph databases) to querying a graph and finally to his personal conclusion. (more…)
ArangoDB 2.5.1 Release: Bug Fixes and Enhancements
This version is deprecated. Download the new version of ArangoDB
A new release of ArangoDB is available for download.
ArangoDB 2.5.1 adds slow-query log and killing running queries to the Http API and to the web-interface. We have also fixed inefficiencies in remove
methods of the general-graph module and solved some issues regarding stability on windows. The added option --database.ignore-logfile-errors
controls how collection datafiles with a CRC mismatch are treated. We recommend to upgrade your 2.5.0 installation to benefit from these improvements.
ArangoDB 2.5.1 could be started from an unzipped archive, no need to install ArangoDB and share libraries in Windows. (more…)
Agile development vs. schema enforcement – a paradox resolved
The fans of modern and agile software development usually propose to use schemaless database engines to allow for greater flexibility, in particular during the early rapid prototyping phase of IT projects. The more traditionally minded insist that having a strict schema that is enforced by the persistence layer throughout the lifetime of a project is necessary to ensure quality and security.
In this post I would like to explain briefly, why I believe that both groups are completely right and why this is not so paradoxical as it sounds at first glance. (more…)
Foxx console – Logging and querying console messages
Aside from the more noticeable features, ArangoDB 2.5 also added the console
object to the scope of all Foxx app modules. Unlike the object already available by importing the console
module, the Foxx console logs all messages directly to the database.
In addition to allowing you to specify per-application log levels to make sure your debug messages don’t end up cluttering your production database, the API also provides useful extras like optionally logging a full stack trace for every message that is stored as a structured list of objects, making them easy to query using AQL. There’s also a number of convenience methods for querying your application’s log entries from within your Foxx code if you prefer keeping it simple.
console.time('do something');
// ... more code ...
console.time('do more stuff');
// ... even more code ...
console.timeEnd('do more stuff'); // => "do more stuff: 23ms"
// ... a little bit more ....
console.timeEnd('do something'); // => "do something: 52ms"
For more information see the chapter on the Foxx console API in the official ArangoDB documentation.
ArangoDB V 2.4.5: Introducing Slow Query Tracking
This version is deprecated. Download the new version of ArangoDB
ArangoDB 2.4.5 is ready to download. The latest release of the 2.4 branch comes with some minor bugfixes and a new feature:
Tracking of AQL queries
We have added current and slow query tracking and also killing of long running AQL queries.
This change enables retrieving the list of currently running AQL queries inside the selected database. AQL queries with an execution time beyond a certain threshold can be moved to a slow query facility and retrieved from there:
ArangoDB 2.5 Release: Enhanced Features & Performance
This version is deprecated. Download the new version of ArangoDB
We are proud to announce the latest release of ArangoDB, adding a bunch of new features and lot’s of improvements to existing ones. ArangoDB 2.5 is available for download now and could be installed from your favourite package manager.
See the previous blogposts on sparse indexes performance, ES6 features in ArangoDB, improved Foxx development process or API Key management to learn more about ArangoDB 2.5 and check the manual for a deeper dive into specific features.
The AWS image of ArangoDB 2.5 will be available shortly.
Please give ArangoDB 2.5 a try and provide us with your valuable feedback.
Git Commit Analysis with ArangoDB: Insightful Data Exploration
I often find myself searching for certain commits using git log
and friends. While I really love the power and flexibility that come with the git and other Unix command-line tools, sometimes it can be more convenient to use a database to filter and aggregate commit data.
I gave it a quick try yesterday and imported the commit history of ArangoDB’s Git repository into ArangoDB and ran some queries on the data.
// retrieving number of commits per month / year
query = 'FOR commit IN commits
COLLECT year = DATE_YEAR(commit.date), month = DATE_MONTH(commit.date)
WITH COUNT INTO count
RETURN { month: CONCAT(year, "/", month), count: count }';
db._query(query).toArray();
While the query results for our repository may not be interesting for everyone, I think it is still worth sharing what I did. Even though I didn’t try it, I think the overall procedure is applicable with any other Git repository.
More queries and how to convert and import Git commits in ArangoDB: Read on in Jan’s Blog
Get the latest tutorials,
blog posts and news:
Thanks for subscribing! Please check your email for further instructions.