Introduction to NoSQl
Introduction to NoSQl
NoSQL was coined by Carlo Strozzi in the year 1998 which is originally referring to a non-relational database management systems database that provides a mechanism for storage and retrieval of data which is different from traditional relational database management systems in some significant ways. These databases are used in real-time web applications and big data and their use are increasing over time. NoSQL systems are also known as Not only SQL to emphasize the fact that they may support SQL-like query languages. The data structures which is use by NoSQL databases are different from those used by default in relational databases which makes some operations faster in NoSQL.
Example-: Facebook collects terabits of data every day for their users. These type of data storing may not require fixed schema, avoid join operations and typically scale horizontally.
Advantages of NoSQL:
There are so many advantages of working with NoSQL databases such as Mongo DB and Cassandra.
- High scalability
- High availability.
- Distributed Computing
- Lower cost
- Schema flexibility, semi-structure data
- No complicated Relationships
Disadvantages of NoSQL:
- Limited query capabilities (so far)
- Eventual consistent is not intuitive to program for
- No standardization
- Narrow focus
CAP Theorem (Brewer’s Theorem)
You must know about the CAP theorem when you talk about NoSQL databases or in fact when designing any distributed system. CAP theorem states Consistency, Availability, and Partition Tolerance
Consistency - This explains that the data in the database remains consistent after the execution of an operation.
Example: after an update operation all users see the same data.
Availability – This explains that the system is always on (service guarantee availability), no downtime.
Partition Tolerance - This explains that the system continues to function even the communication among the servers is unreliable, i.e. the servers may be partitioned into multiple groups that cannot communicate with one another.
There are four general types of NoSQL databases. Each of these categories has its own specific attributes and limitations.
- Key-value stores : Hbase, Big Table, Accumulo
- Column-oriented: BigTable, Cassandra, SimpleDB etc.
- Graph: OrientDB, Neo4J, Titan.etc.
- Document oriented : MongoDB, CouchDB, Cloudant