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