Nothing Special   »   [go: up one dir, main page]

Practical 1 Aim: Introduction To Nosql Database

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

2CEIT405_NO SQL CE AB12

PRACTICAL 1

AIM: INTRODUCTION TO NOSQL DATABASE

• Introduction to NoSQL-DB , RDBMS vs.


NoSQL, CAP theorem.
1. NOSQL DB :
NoSQL is an approach to database design that can accommodate a wide variety of
data models, including key-value, document, columnar and graph formats. NoSQL,
which stands for "not only sql ," is an alternative to traditional relational databases in
which data is placed in tables and data schema is carefully designed before the
database is built.
NoSQL databases . are especially useful for working with large sets of distributed
data.
 NOSQL AVOIDS:
• Overhead of ACID transactions
• Complexity of SQL query
• Burden of up-front schemadesign
• DBA presence
• Transactions (It should be handled at application
layer)
 NOSQL PROVIDES:
• Easy and frequentchanges to DB
• Fast development
• Large data volumes(eg.Google)
• Schema less
• Scaling – horizontal scaling

2. RDBMS vs. NoSQL:


RDMS NOSL
RDBMS APPLICATION STORE NOSQL IS A NON-RELATIONAL
DATA IN THE FORM OF TABLE DATABASE SYSTEM.IT STORES
STRUCTURED MANNER. DATA IN THE FORM OF
UNSTRUCTURED MANNER.

RDBMS SUPPORTS MULTIPLE IT ALSO SUPPORTS MULTIPLE


USERS. USERS.
IT SUPPORTS THE IT DOES HAVE TABLE FORM ,SO
NORMALIZATION AND JOINING IT DOES NOT SUPPORT
OF TABLES. NORMALIZATION.
OPEN SOURCE APPLICATION. OPEN SOURCE PROGRAM.
THIS DATABASE SYSTEM DEALS NO SQL DATABASE MAINLY
WITH A LARGE QUANTITY OF DESIGNED FOR BIG DATA AND
DATA. REAL- TIME WEB DATA.

DIKSHANT 20012011037
2CEIT405_NO SQL CE AB12
HIGH SIFTWARE AND COMMODITY HARDWARE.
SPECIALIZED
DB HARDWARE.

EX. MYSQL, ORACLE,SQL SERVER APACHE HBASE, IBM


ETC. DOMAIN,ORACLE NOSQL
DATABASE ETC.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12
 CAP THEOREM :=
Consistency :=

Consistency means that all clients see the same data at the same time, no matter which node they
connect to. For this to happen, whenever data is written to one node, it must be instantly forwarded or
replicated to all the other nodes in the system before the write is deemed ‘successful.’

Availability:=

Availability means that that any client making a request for data gets a response, even if one or more
nodes are down. Another way to state this—all working nodes in the distributed system return a valid
response for any request, without exception.

Partition tolerance:=

A partition is a communications break within a distributed system—a lost or temporarily delayed


connection between two nodes. Partition tolerance means that the cluster must continue to work despite
any number of communication breakdowns between nodes in the system.

Today, NoSQL databasesare classified based on the two CAP characteristics they
support:
• CP database: A CP database delivers consistency and partition tolerance at the expense of
availability. When a partition occurs between any two nodes, the system has to shut down the non-
consistent node (i.e., make it unavailable) until the partition is resolved.
• AP database: An AP database delivers availability and partition tolerance at the expense of
consistency. When a partition occurs, all nodes remain available but those at the wrong end of a
partition might return an older version of data than others. (When the partition is resolved, the AP
databases typically resync the nodes to repair all inconsistencies in the system.)

• CA database: A CA database delivers consistency and availability across all nodes. It can’t do this
if there is a partition between any two nodes in the system, however, and therefore can’t deliver
fault tolerance.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12
2CEIT405_NO SQL CE AB12

 Basics of Key- value store, Document store, Graph, Object database.


2CEIT405_NO SQL CE AB12

• HERE , FOUR TYPE OF NO SQL DATABASE :=

1) Key value store:=


Data is stored in key/value pairs. It is designed in such a way to handle lots of data and heavy load.

Key-value pair storage databases store data as a hash table where each key is unique, and the value can
be a JSON, BLOB(Binary Large Objects), string, etc.

For example, a key-value pair may contain a key like "Website" associated with a value like "Guru99".

It is one of the most basic NoSQL database example. This kind of NoSQL database is used as a
collection, dictionaries, associative arrays, etc. Key value stores help the developer to store schema-less
data. They work best for shopping cart contents.

Redis, Dynamo, Riak are some NoSQL examples ofkey-value store Data Bases. They are all based on
Amazon's Dynamo paper.

2) Column-oriented Graph:=
Column-oriented databases work on columns and are based on BigTable paper by Google. Every
column is treated separately. Values of single column databases are stored contiguously.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12

They deliver high p


2CEIT405_NO SQL CE AB12

erformance on aggregation queries like SUM, COUNT, AVG, MIN etc. as the data is readily available
in a column.

Column-based NoSQL databases are widely used to manage data warehouses, business
intelligent , CRM, Library card catalogs.

3) Graphs based:=
A graph type database stores entities as well the relations amongst those entities. The entity is stored as
a node with the relationship as edges. An edge gives a relationship between nodes. Every node and edge
has a unique identifier.

Compared to a relational database where tables are loosely connected, a Graph database is a multi-
relational in nature. Traversing relationship is fast as they are already captured into the DB, and there is
no need to calculate them.

Graph base database mostly used for social networks, logistics, spatial data.

4) Document-oriented:=

Document-Oriented NoSQL DB stores and retrieves data as a key value pair but the value part is stored
as a document. The document is stored in JSON or XML formats.
The value is understood by the DB and can be queried.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12
2CEIT405_NO SQL CE AB12

In this diagram on your left you can see we have rows and columns, and in the right, we have a
document database which has a similar structure to JSON.
The document type is mostly used for CMS systems, blogging platforms, real-time analytics & e-
commerce applications. It should not use for complex transactions which require multiple operations or
queries against varying aggregate structures.

 Introduction to Tabular, Tuple store, Triple/quad store (RDF) database,


Hosted, Multivalue databases, Multimodel database.

• TABULAR DATABASE:
A tabular database, as the name implies is a database that is structuredin a tabular
form. It arranges dataelements in vertical columns and horizontal rows. Each cell is
formed by the intersection of a column and row. Each row and column is uniquely
numbered to make it orderly and efficient. This type of databasehas a virtually
infinite rangefor mass data storage.

• TUPLE STORE DATABASE :


In the context of relational databases, a tuple is one record (one row). The information in a
database can be thought of as a spreadsheet, with columns
(known as fields or attributes) representing different categories of
information, and tuples (rows) representingall the information from each field associated with
a single record

• TRIPLE /QUAD STORE (RDF) DATABASE :


The RDF triplestore is a type of graph database that stores data as a network of objects and
uses inference to uncover newinformation out of existing relations. It's flexible and dynamic
nature allows linking diverse data, indexingit for semantic search and enrichingit via text
analysis to build big knowledge graphs.
 MultiValue databases :=
• The MultiValue database is a database system that incorporates the
features of multidimensional and NoSQL databases to store

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12
2CEIT405_NO SQL CE AB12

information. There are significant similarities and diferences between the MultiValue
model and the relational model.
• Both database m odels have schemas and store data in tables.However, MultiValue
databases u se a less rigid schema compared to relational databases.
• An other significant diference is that, in MultiValue databases, a single at tribute can
have a list of values. This means one table cell (attribute) can have several values,
unlike relational databases where each cell can only have one value. Database
developers follow the rules of normalization when designing databases.
• According to the first rule, a database system sh ould eliminate repetition by storing
repeating data in a separate database. However, MultiValue databases discard this
rule to sim plify applications. Although this may not be the best way to store
information in all situations, it is a great way to avoid redundant duplication of data
in certain situations.
• MultiValue Database is a type of NoSQL and multidimensional database.
MultiValue databases differ from a relational database in that they have features that
support and encourage the use of attributes which can take a list of values, rather than
all attributes being single valued. Most of the MultiValue databases can be accessed
both with or without
SQL.
• There are many MultiValue database vendors and individual products may differ in
terms of features. However, the best .

 MultiValue databases have the following features .


1. More than one value to an attribute: Can assign more than one value to a
single attribute and can store multiple values in the cell.
2. Integration: Modern-day database ven dors have realized the importance of
integration. For this reason, MultiValue software ven dors _nd it necessary to
develop database systems that can integrate with other enterprise systems including
both SQL and NoSQL database systems. Also, the best MultiValue databases can
run on different server operating systems including Windows, Unix, and Linux.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12
2CEIT405_NO SQL CE AB12

3. Less Rigid: Multi value databases are less rigid in comparison to other databases.
4. Advanced Security Protocols: The security of any system is one of the most im
portant features. MultiValue database vendors include robust security features such
as robust encryption techniques to secure data and database transactions.
5. ACID Transactions: The best MultiValue database systems support ACID t
ransactions to en sure data integrity when manipulating data. Such t ransactions
guarantee integrity even if there is a system failure or error
CAP Theorm
Base property

 MultiModel Database
Multi-model databases refer to databases that combine different types of database
models into one integrated database engine. They provide a single back end and support
multiple data models depending on the applications they su pport. Such databases can
accommodate various data models including relational, object oriented, key-value,
wide- column, document, and graph m odels. Multi-model databases don’t store data
like ordinary table-based databases and this makes it possible to store all type of data
including semi-structured and unstructured data types. This means that multi-model
databases eliminate the problemof fragmentation and ensure consistency. These
databases can perform most of the basic operations performed by other databases such
as storing data, indexing, and querying. Many database vendors oter multi-model
databases with different features. Prospective users can choose the appropriate database
system for their organization depending on their preferences and the database needs of
the organization. Let’s look at some of thecommon features of multi- model databases.
Top Multi-Model Databases features:= 1.Data
Storage, Backup, and Recovery 2.Querying and
Indexing Mechanisms:
3. ACID Property
4. Integration
5. Advanced Security Features: Data secu rity is one of the most important
features of any database system. Multi-model databases con sist of
advanced security features such as topnotch encryption and auditing
mechanisms to secure your data.

DARJI KISHAN 20012011030


2CEIT405_NO SQL CE AB12

You might also like