Tuesday, November 29, 2011

why I want to learn Mongo

I go long back with the relational databases, since Oracle 6. It was easy to understand and even easier to model. Then I got interested in Java and more in Object Thinking, and of course began to feel the constraints of relational implementation, especially when it came to the "composite" relationship, i.e. when a child entity does not have its own life cycle, and its life cycle is completely dependent on the parent entity, storing it in another table, defining a PK for it (often times a seq number) and making a join for every operation feels a lot of unnecessary work. I understand that in the relational paradigm for the validity and integrity of the data this is the best way. However I always felt there should have been a better way to work with it. With Oracle 9 or may be 8, came the varray and nested tables, but all the db operations with those new structures were pretty clumsy and did not really appeal or fit the Java side, the object oriented view of the data. 
About six months ago I got assigned to a social networking project, customizing of a social networking portal and the short comings of RDBMS I always  suddenly became prominent. That is when I started to learn about the NOSQL databases. The first I read about was the Big table of google, then the simpledb of amazon, and then couchdb. I then found out that all NOSQL is not equal.
Big table type of nosql can essentially have a different schema for each row, Simple DB falls in the category of simple key value pair storage and couch is more of a document style database. Lately I also came across the fourth category, Graph databases, the only one I know a little bit about is Neo4j, a purely java based nosql db.
From whatever I read, it is clear the big table and simple db would be very easy to use for specific applications but not many applications would fall in those categories. Document based  db on the other hand felt the closest to the RDB. Once I came to this conclusion I started reading more and some how settled on the idea of learning Mongo db, why?
1. It was easy to download and get it running.
2. The documentation gave parallels between the RDB and Mongo.
3. The parallels are not only conceptual but also in terms operations.
4. It has drivers for many languages, especially for Java, which means I dont have to learn a new language in order to learn Mongo.
5. There is even a JPA project Morphia for Java-Mongo.
6. The shell is javascript, being a web developer I am pretty conversant with it.
7. NYC has a good meetup group of mongo.
8. The mongodb site is pretty dynamic
All in all, I feel very comfortable with Mongo. I could get it running on windows.

All the literature I have read so far, I dont think learning the commands or even accessing the db via drivers will difficult, the real challenge will be the database modeling. I have a feeling that I can still continue thinking the world in terms E-R but I will have to map them in a different way than in RDB.
I hope to work on a good project and continue to think loudly of my mongo expereinces.



 












No comments:

Post a Comment