Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move Data from SQL to Aerospike

I want to transfer lot of data(>10gb) from my MySQL database to Aerospike. What is the best approach for the same? I know that I can dump MySQL data to CSV and then read it in Aerospike but I wanted to know if their is any other approach with smaller SLA or more secure way for it.

like image 756
user3118438 Avatar asked Feb 17 '16 07:02

user3118438


2 Answers

The easiest would be to SELECT INTO OUTFILE using the necessary delimiters and line endings to make the output CSV compatible. You would then use the aerospike loader tool (aerospike/aerospike-loader) to load the data into Aerospike. The tool allows you to use multiple threads to read and write in parallel, so it's quite fast.

like image 152
Ronen Botzer Avatar answered Sep 22 '22 10:09

Ronen Botzer


If you are interested in a one-time migration only I would recommend the CSV-Export/-Import way. If you migrate the table structure (CREATE-Statements) you dont have to worry about the datatypes too much.

Another way would be a script/programm/ETL-Tool connecting to mysql, read line-by-line and write line-by-line (entity-by-entity?) to aerospike. Depending on the brain you invest in such a solution you might/might not end up with a (very) slow/fast solution. imho this makes sense for a regular data exchange only.

like image 25
Benvorth Avatar answered Sep 24 '22 10:09

Benvorth