Presentation is loading. Please wait.

Presentation is loading. Please wait.

SQL vs NoSQL Database BY: DEEPENDRA CHAUDHARY. Abstract This presentation reviews the features common to the NoSQL database and compares those features.

Similar presentations


Presentation on theme: "SQL vs NoSQL Database BY: DEEPENDRA CHAUDHARY. Abstract This presentation reviews the features common to the NoSQL database and compares those features."— Presentation transcript:

1 SQL vs NoSQL Database BY: DEEPENDRA CHAUDHARY

2 Abstract This presentation reviews the features common to the NoSQL database and compares those features to the features and capabilities of SQL database. NoSQL database is referred to either no- SQL or Not Only SQL

3 Topics SQL databases  SQL history  SQL characteristics  SQL database Examples NoSQL Databases  NoSQL Definitions  General Characteristics  NoSQL Database Types and examples

4 SQL History Short history of SQL Database  SQL: Structured Query Language  SQL is based on the tuple calculus and relational algebra  Consists of data definition language, data manipulation language and data control language  SQL became a standard of the American national standards institute (ANSI) in 1986 and international Organization for standardization (ISO) in 1987  In 1970 IBM came with this idea and implemented in several database libraries

5 Characteristics  Data stored in columns and table  Relationships represented by data  Data manipulation language(DML)  Syntax elements similar to a computer programming languages used for selecting, inserting, deleting and updating database  Data definition language  DDL is a standard commands that define the different structures in a database.  It Creates modify and remove database objects such as tables, index and users.  Database abstraction layer  Application programming interface that unifies the communication between computer application such as SQL Server, DB2, MYSQL….

6 Cont’d  Acid Properties:  Atomicity:  Means that all the effects of the transaction must be completed successfully or the changes are rolled back. For example, withdrawal from ATM machine; the machine must both dispense the cash and debit to bank account.  consistency:  The consistency requirements ensure that the transaction cannot break the integrity rules of the database; it must leave the database in a consistent state. For example ; the data “I” in sex field must be either male or female.  Isolation:  Isolation refers to keeping the changes of incomplete transactions running at the same time separate from one another. Each transaction must be entirely self-contained, and changes it makes must not be readable by any other transaction  Durability:  Once a transaction is committed, it must persist even if there is a system failure — that is, it must be durable. In SQL Server, the information needed to replay changes made in a transaction is written to the transaction log before the transaction is considered to be committed.

7 SQL Database Examples  Commercial  Oracle  IBM  Microsoft SQL server  Sybase SQL  Open Source  MySQL  Ingres

8 NoSQL Database Definition:  A NoSQL (originally referring to "non SQL" or "non relational") database provides a mechanism for storage and retrieval of data which is modeled in means other than the tabular relations used in relational databases.

9 List of NOSQL Databases:  Cassandra  Hypertable  Amazon simpleDB  Cloudata  Accumulo  IBM Infomix  Splice Machine  eXtremeDB Finincial edition …etc  mongoDB  couchDB  RethinkDM  SequoiaDB  NeDB  Terrastore  JSON ODM  Clusterpoint server…etc  Neo4j  Sparksee  TITAN  IinfoGrid  GraphBase  Infinit Graph  Trinity  White DB…etc

10 NoSQL Characteristics  Non-relational  Schema-less  Open source

11 Non-Relational  NoSQL database are generally non-relational, meaning they do not follow relational model  They do not provide tables with flat fixed column records  Instead, it is common to work with self contained aggregates or even BLOGS  Helps to eliminates the need for complex object-relational mapping and many data normalization requirements

12 Schema-Free  NoSQL database are schema-free  There is no need to define any sort of schema for the data  Being schema free allows different records in the same domain (e.g. “user”) to have heterogeneous structure  This helps to migrate data easily

13 NoSQL Database Types  Four Categorized depend upon data-model they support..  Document stores  Graph database  Wide column database  Key-value stores

14 Document stores  Documents are self-contained, aggregate data structure  They consist values data types which can also be nested  Documents are main concept  A document-oriented database stores and retrieves documents(XML,JSON and so on).  Examples of Document database  MongoDB  CouchDB  RethinkDB  RavenDB

15 Document Store Dbs. Cont‘d How to Save Data.. mongo>db.user.save ({ ID: “1”, Name: “ deependra”, Email:” kkkkkk@gmail.com”,kkkkkk@gmail.com Favcolor: [“Blue”,”Red”] }); Query Interface to get data.. In MongoDB db.user.find({favcolor: “Blue”}) In SQL Select * From users Where favcolor = “Blue”;

16 CouchDB Cont’d  To create a database “user” for storing documents, send and HTTP PUT request to server: >curl –x Put http://couchdbhttp://couchdb: 44444/user  To save the user object as a document >curl –x POST -d ‘{“_id”: “1111”,……}’ http: //couchdb:44444/user  To get the object using its ID, simply by sending GET request: > curl-x GET http://couchdb:44444/user/1111

17 Key-value store  The key value type basically uses hash table in which in which there exists a unique key and a pointer to a particular item  Key value is very efficient for basic operations on keys such as set, get, del, replace, incr, decr  In a key-value store, a value is mapped to a unique key  To store data >store. Set(“user- 1254”);  To get data >value = store. Get(“user -1254”); Keyvalue “BSU”“131 Summer St ” “FSU”“600 W College Ave”

18 Column Store Database  In column store database, data is stored in cells grouped in columns of data rather rows  Column families can obtain a virtually unlimited number of columns that can be crated during runtime  Row keeps all the information about one entity together  Column stores all attributes information together  Example: Hbase, Cassandra ID 1 2 Title The Fly The Birdcage Genre Horror Comedy

19 Graph Database  In computing, a graph database uses graph structures for semantic queries with nodes, edges and properties to represent and store data  In other word, its an abstract representation of a set of objects where some pairs are connected by links object(vertex, node) link( edge, arc, relationship)  Most graph database are NoSQL in nature and store their data in a key- value store or document-oriented database  Data can be easily transformed from one model to other using Graph Base NoSQL database

20 Graph Database cont’d  What is Neo4j ? Neo4j is a graph database management system developed by Neo Technology, Inc. Introduced in 2010 It is similar to ACID – compliant transactional database with native graph storage and processing Most popular graph database according to db-engines.com It is open source and java based Full linked with nodes Stores data as nodes and relationships

21 How Neo4j Works Storing Objects  Domain objects take a node  Jo4neo framework Public class person{ //used by jo4neo Transient Nodeid node; //simple property @new string firstNmae; //helps to store a java.util.date to neo4j @neo Date date; //jo4neo will index for you @neo (intex =true) sting email; //many to many relation @neo collection roles; }

22 When to use NoSQL?  If high quantity of data is need to retrieve  If storing relationship between the elements is not important  While dealing with growing lists of elements: like twitter posts, blogs, internet server logs  While dealing with unstructured data and structured is changing readily with time then NoSQL is answer

23 References: http://www.thegeekstuff.com/2014/01/sql-vs-nosql-db/ https://en.wikipedia.org/wiki/SQL http://www.planetcassandra.org/what-is-nosql/ http://www.infoworld.com/article/2983953/nosql/how-to-choose-a-nosql-analytics- system.html http://www.nosql-database.org/ http://www.dataversity.net/8-defining-characteristics-of-nosql-systems/ http://www.infoq.com/articles/graph-nosql-neo4j http://neo4j.com/product/ https://www.youtube.com/watch?v=Eay2Ylhuf0k https://www.youtube.com/watch?v=lZB6D-XNH0A


Download ppt "SQL vs NoSQL Database BY: DEEPENDRA CHAUDHARY. Abstract This presentation reviews the features common to the NoSQL database and compares those features."

Similar presentations


Ads by Google