Posts

TYPES OF NOSQL DATABASE

Image
Mainly, NoSQL database are of four types namely Key-Value Stores. (e.g. Riak, Redis, MemcacheDB) Column-family Stores .(e.g. HBase, Cassandra) Document-Oriented Database . (e.g. MongoDB, CouchDB) Graph Database . (e.g. Neo4J, HyperGraphDB, InfoGrid) We will discuss each type one by one. 1. KEY-VALUE STORES Key-Value Store is the simplest form of NoSQL database. It stores information as key  and its value. These are similar to a dictionary or a hashtable. Fig 1.a. Example of Key-Value Stores Each key is unique and note that we can search only by using keys, not by values. They are inefficient when you need to query or update only a part of the value. Key-Value Store are used to implement shopping carts, user sessions, customer preferences etc. 2. COLUMN- FAMILY STORES Since key-value stores do not allow updating only a part of value and we cannot fetch data by using values rather than key. Column family databases store each column separa

CAP THEOREM NOSQL

Image
All databases should ideally provide the following features: CONSISTENCY Consistency is when an end user must be able to see the latest data at all times. AVAILABILITY Availability is when every database request must be responded by the server. PARTITION TOLERANCE   When two systems cannot talk to each other in a network, it is called network  partition . Our DB system should continue to function even if there is a network partition. Consistency ,  Availability and  Partition Tolerance is usually abbreviated as  CAP. CAP THEOREM'S DEFINITION This theorem is stated by Eric Brewer. According to this theorem  it is impossible for a distributed system to guarantee all three (Consistency, Availability and Partition Tolerance). NoSQL databases are partition tolerant. In case of a network partition, there is a tradeoff between consistency and availability – some NoSQL systems give importance to Consistency while others give importance to Availability.

SQL vs NO SQL

Image
Structure Query Language (SQL) is the conventional way of storing and accessing the data from the database. But as the Internet grows, data also had grown significantly which has resulted in giving birth to various storage problems. Now we are going to provide you the difference between SQL and No-SQL  SQL NO SQL It stores data in relational representation, i.e, data is stored in tables Data is not stored in the form of tables It has a fixed structure or schema It does not have any fixed structure It's architecture is centralized database i.e, it stores and process data centrally. Fig 1.a.  Centralized SQL Database In this data is stored in various distributed machines. Fig 1.b. Distributed NoSQL Database If the central DB server goes down, no users request can be processed If any DB server goes down, user request can be processed from remaining servers Response time gets slower as the concurrent users increases Since user requ