MongoDB normalization, foreign key and joining

MongoDB doesn’t support server side foreign key relationships, normalization is also discouraged. You should embed your child object within parent objects if possible, this will increase performance and make foreign keys totally unnecessary. That said it is not always possible, so there is a special construct called DBRef which allows to reference objects in a … Read more

SQL (MySQL) vs NoSQL (CouchDB) [closed]

Here’s a quote from a recent blog post from Dare Obasanjo. SQL databases are like automatic transmission and NoSQL databases are like manual transmission. Once you switch to NoSQL, you become responsible for a lot of work that the system takes care of automatically in a relational database system. Similar to what happens when you … Read more

Difference between HBase and Hadoop/HDFS

Hadoop is basically 3 things, a FS (Hadoop Distributed File System), a computation framework (MapReduce) and a management bridge (Yet Another Resource Negotiator). HDFS allows you store huge amounts of data in a distributed (provides faster read/write access) and redundant (provides better availability) manner. And MapReduce allows you to process this huge data in a … Read more

How to create and insert a JSON object using MySQL queries?

On creating table set your field as JSON datatype. CREATE TABLE `person` ( `name` json DEFAULT NULL ); And Insert JSON data into it, INSERT INTO `person` (`name`) VALUES (‘[“name1”, “name2”, “name3”]’); Or Insert JSON data by Key:Value INSERT INTO person VALUES (‘{“pid”: 101, “name”: “name1”}’); INSERT INTO person VALUES (‘{“pid”: 102, “name”: “name2”}’); Select … Read more

Why isn’t RDBMS Partition Tolerant in CAP Theorem and why is it Available?

It is very easy to misunderstand the CAP properties, hence I’m providing some illustrations to make it easier. Consistency: A query Q will produce the same answer A regardless the node that handles the request. In order to guarantee full consistency we need to ensure that all nodes agree on the same value at all … Read more

Is mongodb running?

check with either: ps -edaf | grep mongo | grep -v grep # “ps” flags may differ on your OS or /etc/init.d/mongodb status # for MongoDB version < 2.6 /etc/init.d/mongod status # for MongoDB version >= 2.6 or service mongodb status # for MongoDB version < 2.6 service mongod status # for MongoDB version >= … Read more