Posts

Showing posts with the label NoSQL

Import data from mysql to mongo

To import data from mysql into mongodb we need to export data from mysql in a format mongo likes, this is either a tsv or a csv. Ideally you would like to use the following sql select columns INTO OUTFILE '/path/to/csv'    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'    LINES TERMINATED BY '\n' from table [where clause] What the above SQL does is exports the data (only data , no headers) into a file as provided in your path, make sure you have access to location where you are putting the file. If you ignore the path and just use the filename this will be stored in the location where mysql data files are stored. To get the fields in the data file, we can use the following     echo "SELECT * FROM ;" | mysql -uXXX -pXXX > '/path/to/ .tsv' Finally you want all the be imported into a mongo database, here since our file contains a header we specify the --headerline option. For a complete list of...

Does NoSQL means you forget everything you learnt at RDBMS school?

I found it interesting to see how to integrate NoSQL, but more interesting was to unlearn somethings i learnt through years of training - denormalise! Normalisation was the term that made rdbms, good normalisation design was supposed to be a hallmark of a good database designer. But NoSQL is different, forget joins forget collecting data from 10 different tables NoSQL is radically different and the best part is it works for very large datasets, is distributed, and some very big installations like twitter, amazon and others mean if you don't look at this seriously soon you will be in trouble. Drupal by itself doesn't support NoSQL out of the box and you don't throw away mysql yet, there is a module (cassandra) that was recently added on drupal.org which is worth checking, One possible way of integrating with drupal is using a nosql may be casandra or mongodb with your entities, infact this is one of the best things of entities, your fields can live in a separate database ...