Over a million developers have joined DZone.


DZone's Guide to


· Database Zone ·
Free Resource

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

Last few months my work involved some web services stuffv(SOAP). For a variety of reasons,SOAP was chosen over REST,which means i had to deal again with XML's. There are plenty of libraries and tools in market to parse or build a XML,but still never in my life i felt comfortable with xml parsers.

Heard a lot about json and wanted to give it a try some time.In my current work,there was a scenario,where i had to persist the state of object and reuse it at a later point of time.

Yeah, immediate thing that came to my mind was xml, but then the complexity of using a binding framework like jaxb, castor, etc. with their annotations, xml mapping file, blah blah... looked like complicating the whole stuff.  My first try at json was like a breeze.

All I had to do was add a json library (I used google gson).  The syntax looked like,

gson .toJson(object)
gson .fromJson(string)

That's it.  You just converted your string to json format and vice versa.  As simple as it gets.more readable and it took only half the space to store the same data in the db.
So.. definitely JSON looks more simpler and efficient.recently ,many would have come across the buzzword "nosql" db.intial thoughts were,its not for enterprise applications. but the concept of non-relational database makes more sense now.

Let's assume I had to save a simple registration form.the user inputs name,age and sex.  A typical RDBMS in this scenario will have a table with 3 columns for name,age and sex and maybe one sequence generated ID column.sometime later,there is a new requirement to store address as well. Yes, one ends up modifying the schema and face all the hassles related to data migration process.

What if we used a nosql db which stores data in key/value pair?  Lets say key is some unique id and value is the complete registration form.  Nosql db allows you to store the complete document as value to the given key.and they have seems to have a nice query language too.so,which means your db is naturally scalable and its very much possible that you retrieve the data in json format and directly pass to the javascript in UI(in many scenarios).  Current javascript libraries like jquery, protoype, etc. are getting better and better every day.

And there seems to be many big players in the nosql league like hbase,mongodb,couchdb,cassandra,etc. They are getting more attention as facebook, twitter, etc. recently switched to such schema free database.  Maybe its the end of RDBMS and XML world .

Get comfortable using NoSQL in a free, self-directed learning course provided by RavenDB. Learn to create fully-functional real-world programs on NoSQL Databases. Register today.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}