This post has already been read 6125 times!
Most of you are already familiar with SQL database, and have a good knowledge on MySQL, Oracle, or other SQL databases. But now a days, the approach of developers towards the NoSQL oriented database is increasing in industry.
Relational and NoSQL data models are very different. The relational model takes data and separates it into many interrelated tables that contain rows and columns. Tables reference each other through foreign keys that are stored in columns as well. When looking up data, the desired information needs to be collected from many tables (often hundreds in today’s enterprise applications) and combined before it can be provided to the application. Similarly, when writing data, the write needs to be coordinated and performed on many tables.
A Scenario : Social Gaming
Social games are data-intensive applications that can explode from zero to millions of players literally overnight. That kind of rapid growth, both in terms of data volume and number of users, necessitates the right class of database to store all that information and scale to a growing user base.
To store this data rapidly, in traditional SQL database, a developer really need to invest lot of coding standards and it will becomes very difficult to manage such scenario using SQL as it requires a constant and rapid updates in data. It is often observed that in such cases the performance will be key issue. NoSQL provides scalability, consistently high performance, always-on 24×365 operations and a flexible data model to resolve this. Some of the most popular social and mobile games come from the likes of Zynga, Electronic Arts, Tencent and Shuffle Master, which are all powered by NoSQL.
To go through the concept of NoSQL, one really has to know JSON.
The following example stores information of “book” in JSON format :
“author”: “Herbert Schildt”
Traditionally this language in-dependant, light-weight data can be stored in XML format, but JSON has some advantages over XML
- JSON requires less tags than XML – XML items must be wrapped in open and close tags whereas JSON you just name the tag once
- Because JSON is transportation-independent, you can just bypass the XMLHttpRequest object for getting your data.
- You can get JSON data from anywhere, not just your own domain.
- JSON is easier to read than XML – Obviously a personal preference
NoSQL databases have a very different model. For example, a document-oriented NoSQL database takes the data you want to store and aggregates it into documents using the JSON format. Each JSON document can be thought of as an object to be used by your application. A JSON document might, for example, take all the data stored in a row that spans 20 tables of a relational database and aggregate it into a single document/object. Aggregating this information may lead to duplication of information, but since storage is no longer cost prohibitive, the resulting data model flexibility, ease of efficiently distributing the resulting documents and read and write performance improvements make it an easy trade-off for web-based applications.
NoSQL is a whole new way of thinking about a database. NoSQL is not a relational database. The reality is that a relational database model may not be the best solution for all situations. The easiest way to think of NoSQL, is that of a database which does not adhering to the traditional relational database management system (RDMS) structure. Sometimes you will also see it revered to as ‘not only SQL’.
It is not built on tables and does not employ SQL to manipulate data. It also may not provide full ACID (atomicity, consistency, isolation, durability) guarantees, but still has a distributed and fault tolerant architecture.
Over the years, the implementation of NoSQL in increasing through different databases and currently around 150 databases are available in industry which are following the NoSQL concept.
Following are some of commonly used databases :
In my coming blogs, I will take you to the next levels of NoSQL by concentrating one of the database i.e. MongoDB.