JSON and NoSQL DB's
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,
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.
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 .
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)