Sunday, 13 July 2014

Hello NoSQL World

The Architects group in Kewill Product Development have been evolving a model reference architecture for the next generation products that will offer cutting edge features to our customers. NoSQL databases are one of the key components of the new architecture; though we already use them in our existing product suite, they will have an enhanced role to play in the future. We are going with MongoDB.

Having been used to relational databases for most part of my career, the NoSQL flavor is an interesting and welcome change to application development. To get a first hand feel for MongoDB, I wrote a couple of newbie Hello-World programs each for inserting into and fetching data from MongoDB and MySQL.

I inserted a million records into MongoDB in the first program. In the second program, I fetched those million records and printed to screen. For MySQL, I inserted 20,000 records in the first program. In the second program, I fetched those 20,000 records and printed to screen.

The insert blew my mind away; MongoDB is a clear winner. It takes ages to insert data into MySQL. For the fetch, I am a bit unclear. Here are the results of the run:

MongoDB
Insert a million records ---------------------------------- 25303 ms (23.3 seconds)
Fetch & print the million records ---------------------- 267479 ms (4 minutes 27.5 seconds)

MySQL
Insert 20,000 records ------------------------------------- 806178 ms (13 minutes 26.2 seconds)
Fetch & print 20,000 records --------------------------- 4415 ms (4.5 seconds)

Platform : Dell Latitude laptop E6410 with i5 M250 processor @ 2.4 GHz & 8 GB RAM, 64-bit Windows 7 Professional, jdk 1.6.0_45, mongo v2.6, MySQL 5.6.

Here are the programs:





No comments:

Post a Comment