home shape

Setting Up Test Data: ArangoDB Tutorial & Best Practices

Today I was asked to look at code that was supposed to read data from a MySQL data source, process it and then import it into ArangoDB.

To run and debug the code I had to have some MySQL data source. So I thought I’d quickly set up a simple example table with a few rows. It turned out that this took more time than what I had expected.

Maybe I’m spoilt by JavaScript-enabled, schema-free databases where creating such test setups is so much easier.

Read more on Jan’s Blog

Jan Steemann

Jan Steemann

After more than 30 years of playing around with 8 bit computers, assembler and scripting languages, Jan decided to move on to work in database engineering. Jan is now a senior C/C++ developer with the ArangoDB core team, being there from version 0.1. He is mostly working on performance optimization, storage engines and the querying functionality. He also wrote most of AQL (ArangoDB’s query language).

2 Comments

  1. Bruce Feng on September 27, 2019 at 8:10 am

    Hello Jan,
    Are you writing a pesonal script to read data from a MySQL data source, and then import it into ArangoDB? I wonder if there’s a plug-in(API) of ArangoDB to import data from MySQL database to ArangoDB.

  2. Jan on September 30, 2019 at 9:50 am

    Hi,
    I haven’t written a script to import data from MySQL into ArangoDB.
    However, if you can export data from MySQL into JSONL (line-based) or CSV (comma-separated values) files, you can use the tool arangoimport to import the data into ArangoDB. arangoimport comes bundled with ArangoDB.
    You will need to do this per collection, but that should be easily scriptable. Additionally, indexes will need to be created manually on the collections/attributes for which this is sensible.
    All that being said, it may make sense to do additional transformations on the MySQL data before importing it back into ArangoDB. For example, in MySQL your primary key can be of any data type, but in ArangoDB the primary keys need to be string values. Other transformations may make sense too, but that clearly depends on the data model in use.

Leave a Comment





Get the latest tutorials, blog posts and news: