SlideShare a Scribd company logo
NOSQL database
NoSQL
 Semi-structured data is also an important element of many NoSQL
 (“not only SQL”) databases.
 NoSQL databases differ from relational databases because they do not separate
the organization (schema) from the data.
 This makes NoSQL a better choice to store information that does not easily fit into
the record and table format, such as text with varying lengths.
 It also allows for easier data exchange between databases.
 Some newer NoSQL databases like MongoDB and Couchbase also incorporate
semi-structured documents by natively storing them in the JSON format.
Prof.Indrani Sen MCA,MPhil Computer Science
What is NoSQL Database?
 NoSQL databases basically called as Not Only SQL database.
 These databases are non-relational database systems used for storing and
retrieving data.
 Nowadays NoSQL Databases are predominantly utilized as real-time based web
applications.
 NoSQL databases can therefore be called as Big Data databases or Cloud
databases.
 NoSQL Databases are faster in compared to SQL Databases and thus it makes
major part of Data applications.
Prof.Indrani Sen MCA,MPhil Computer Science
 Database design in relational models uses primary and foreign keys and follows
strict constraints when the tables are created.
 The main motto of NoSQL is that the relational databases are good for smaller
data storage requirements,
 but “big data” are mostly used to manage large queries.
 To properly manage big data queries NoSQL databases are appropriate which
work differently than the relational databases.
Prof.Indrani Sen MCA,MPhil Computer Science
NoSQL features Result
Big Data types Structured,
unstructured and
semi-structured
Scalability Excellent
Biggest NoSQL
advantages
Large volumes of data,
dynamic schemas,
replication, auto-
sharding
Prof.Indrani Sen MCA,MPhil Computer Science
Why are NoSQL Databases so popular?
 Elastic scalability – These databases are highly scalable and allow adding more hardware.
 These are implemented to increase customers and provide service as per there requirement.
 Architecture based – Lesser failures or system downtimes as these are continuously available for business-
critical applications.
 Linear-scale performance – These are linearly scalable which increase the throughput of system which is
directly proportional to the number of nodes in the cluster. Therefore it helps to maintain a quick
response time.
 Flexibility in data maintenance – The data storage includes: structured, semi-structured, and unstructured.
 The changes are done as per our requirements.
 Easy data distribution – Distribution of data can be replicated across multiple data centers.
 Fast writes – These databases are designed to run on cheap commodity hardware. They perform write
operations in blazingly fast speed and store hundreds of terabytes of data, without affecting the read
efficiency.
Prof.Indrani Sen MCA,MPhil Computer Science
Top NoSQL market players
CouchDB
 CouchDB is an Open Source NoSQL Database based on JSON to stores data and
JavaScript in the form of query language.
 CouchDB is a multi-version controlling system for avoiding the blockage of the DB
file scripting.
 It has been ranked as the best database in the year 2016 on the basis of its highest
popularity among all the NoSQL Databases.
Prof.Indrani Sen MCA,MPhil Computer Science
MongoDB
 MongoDB is the most popular among NoSQL Databases which is a free and open-
source document-oriented database program.
 It is a scalable and accessible database.
 It is prescribed in C++ but uses JSON-like documents with schemas as JavaScript
can be utilized as the query language.
 MongoDB scales horizontally which is preferable in JavaScript frameworks.
Prof.Indrani Sen MCA,MPhil Computer Science
Cassandra
 Cassandra is a distributed data storage system from Apache for handling very large amounts of
structured data and highly scalable.
 Essentially, these data are widely used across many commodity servers, providing high availability
with no failure till now.
 It gives you the maximal flexibility for distribution of data.
 It allows adding data storage to your service online and makes your task much easier.
 There is no scope for complex configuration as all the nodes in a cluster are same.
 Cassandra is java based programming language which supports MapReduce on Apache Hadoop.
 Cassandra Query Language (CQL) is an SQL-like language for querying Cassandra Database.
Prof.Indrani Sen MCA,MPhil Computer Science
Graph model
Properties
 One such approach is the property graph model, where data is organized as
nodes, relationships, and properties
 (data stored on the nodes or relationships).
 Nodes are the entities in the graph.
 They can hold any number of attributes (key-value pairs) called properties.
 Nodes can be tagged with labels, representing their different roles in your
domain.
 Relationships provide directed, named, semantically-relevant connections between
two node entities (e.g. Member ISSUE_RETURN Book).
Prof.Indrani Sen MCA,MPhil Computer Science
Prof.Indrani Sen MCA,MPhil Computer Science
MongoDB
MONGODB IS A CROSS-PLATFORM, DOCUMENT ORIENTED DATABASE THAT
PROVIDES, HIGH PERFORMANCE, HIGH AVAILABILITY, AND EASY
SCALABILITY. MONGODB WORKS ON CONCEPT OF COLLECTION AND
DOCUMENT.
Mongodb installation
MongoDB Community Download | MongoDB
Mongodb
Use your windows UserId and password( if password
is not there you have to create)
If you are installing as a network service uncheck this in
windows 10
Install the interface
Download Studio 3T for MongoDB | Windows,
macOS & Linux
Creating database
 The use Command
 MongoDB
 use DATABASE_NAME is used to create database. The command will create a new
database if it doesn't exist, otherwise it will return the existing database.
 >use mydb
switched to db mydb
To list databases
 >show dbs
 local 0.78125GB
 mydb 0.23012GB
 test 0.23012GB
Deleting database
 The dropDatabase() Method
 db.dropDatabase() command is used to drop a existing database.
 Syntax
 db.dropDatabase()
 This will delete the selected database.
 If you have not selected any database, then it will delete default 'test' database.
Collections
 MongoDB stores documents in collections.
 Collections are analogous to tables in relational databases.
 Create a Collection
 If a collection does not exist, MongoDB creates the collection when you first store
data for that collection
Creating collection
 The createCollection() Method
 MongoDB db.createCollection(name, options) is used to create collection.
 Syntax
 db.createCollection(name, options) In the command, name is name of collection
to be created. Options is a document and is used to specify configuration of
collection likememory size etc.
List collections
 >db.createCollection("mycollection")
 using the command show collections.
 >show collections
 In MongoDB, you don't need to create collection. MongoDB creates collection
automatically, when you insert some document.
Documents
 A record in MongoDB is a document, which is a data structure composed of field and value pairs.
 MongoDB documents are similar to JavaScript Object Notation objects but use a variant called Binary
JSON (BSON) that accommodates more data types.
 The fields in documents are akin to the columns in a relational database, and the values they contain can
be a variety of data types,
 including other documents, arrays and arrays of documents
 Documents, which also must incorporate a primary key as a unique identifier, are the basic unit of data in
MongoDB.
 Collections contain sets of documents and function as the equivalent of relational database tables.
 Collections can contain any type of data, but the restriction is the data in a collection cannot be spread
across different databases.
Advantages of mongodb
 Flexible schema
 No need of joins
 Faster queries
 Document based model
 Efficient for Haddoop implementation
Prof.Indrani Sen MCA,MPhil Computer Science
Components of MongoDB
Database
 Database is a physical container for
collections. Each database gets its own set of
files on the file system.
 A single MongoDB server typically has
multiple databases.
Prof.Indrani Sen MCA,MPhil Computer Science
Collection
 Collection is a group of MongoDB documents.
 It is the equivalent of an RDBMS table.
 A collection exists within a single database.
 Collections do not enforce a schema.
 Documents within a collection can have different fields.
 Typically, all documents in a collection are of similar or related purpose.
Prof.Indrani Sen MCA,MPhil Computer Science
Prof.Indrani Sen MCA,MPhil Computer Science
 [Recipe_details
 {recipe_id ,
 Name:Lucknowi Mutton Biryani,
 summary:Lucknowi Mutton Biryani is a very popular North Indian recipe. It is different
from the basic biryanis as it come straight from the Nawabs and is the soul of every
party. It is made from cashewnut paste, saffron, curd, star anise and mace powder that
give it an amazing flavour. In this delightful recipe, the process of marination is very
important. The longer you marinate the meat, the better is the taste of the biryani. It is
also important to soak the rice in water for sometime,
 date_publish: 2017-05-15T15:45:37+05:30
 category:Main
 Cuisine:Awadhi
 preptime:PT15M
 Tottime:PT40M
 Yield:4 Servings
MongoDB
 [Recipe_details {recipe_id , title,summary,author,
date_publish,category,cuisine,preptime,cooktime,
yield,ingredient_list,instruction_list,
 [recipe_qty{ qty,unit,Ingredient_name, ref_id_list{ingredient_name ,
feature_list,category} ]
 Instruction[ {method_name, time, tool, [Ingredient{ingredient_name ,
feature_list ,category} ]
 }]
Prof.Indrani Sen MCA,MPhil Computer Science
Library database
Prof.Indrani Sen MCA,MPhil Computer Science
Transactions
 Transactions in a database environment have two main purposes:-
 Reliability of data: In case of unpredictable circumstances such as power failures or
system failures while a database is getting updated or being read,
 the transactions should ensure to give us consistent and accurate data.
 Concurrent Access of data:When more than one user or application programs are
trying to access the same data,
 the transactions should provide isolation between the programs accessing a database
concurrently.
 Otherwise concurrent read or write operations to a database may lead to inconsistent
or erronaeous data.
Phases of transaction
 Begin the transaction.
 Execute a set of data manipulations and/or queries.
 If no errors occur then commit the transaction and end it.
 If errors occur then rollback the transaction and end it.
Atomicity
 A transaction is an atomic unit of processing;
 it is either performed in its entirety or not performed at all.
 The atomicity property requires that we execute a transaction to completion.
 It is the responsibility of the recovery subsystem of a DBMS to ensure atomicity.
 If a transaction fails to complete for some reason, such as a system crash in the
midst of transaction execution,
 the recovery technique must undo any effects of the transaction on the database.
ATM(withdrawal) Database Recovery Manager
Account_Balance =
Account_Balance -
Withdraw _amt
Account
debited
Crash/Transaction
Error
Transaction
rollback
Account_Balance=
Account_Balance +
Withdraw _amt
Account
credited/
reversed
Consistency preservation:
 The DBMS has to ensure that the transaction preserves data consistency in a
database and does not violate any integrity constraints .
 A database program should be written in a way that guarantees that, if the
database is in a consistent state before executing the transaction,
 it will be in a consistent state after the complete execution of the transaction,
 assuming that no interference with other transactions occurs
 Consider an account hoder tries to withdraw an amount from his Account where
withdraw_amt is greater than the balance,
 then the transaction should not cause a change in the database as the action will
violate a constraint in the database .
 So the DBMS programmers must ensure that such a constraint should exist which
will not allow the database to go in an inconsistent state.
 A Bank employee tries to open an Account with the same Account_no which
already has been assigned to another Account holder,
 in this case the transaction should ensure that the Account_no should not be
duplicated and hence maintain database integrity.
Isolation:
 A transaction should appear as though it is being executed in isolation from other
transactions.
 That is, the execution of a transaction should not be interfered with by any other
transactions executing concurrently.
Durability or permanency
 The changes applied to the database by a committed transaction must be
permanent in the database.
 These changes must not be lost because of any failure.
 For example ,Consider the Account_holder is transferring funds from Account A to
Account B then under the following conditions,
 the changes should be permanent and cannot be reversed
 even if the application crashes
 or an error occurs
 or the user decides to cancel the transaction after the transaction is over
Some Transaction Primitives
Examples of primitives for transactions.
Primitive Description
BEGIN_TRANSACTION Make the start of a transaction
END_TRANSACTION Terminate the transaction and try to commit
ABORT_TRANSACTION Kill the transaction and restore the old values
READ Read data from a file, a table, etc.
WRITE Write data to a file, a table, etc.
Base Model:
 The rise in popularity of NoSQL databases provided a flexible and fluidity with
ease to manipulate data and as a result,
 a new database model was designed, reflecting these properties.
 The acronym BASE is slightly more confusing than ACID but however, the words
behind it suggest ways in which the BASE model is different
BASE
1. Basically Available:
2. Instead of making it compulsory for immediate consistency,
3. BASE-modelled NoSQL databases will ensure the availability of data by spreading
and replicating it across the nodes of the database cluster.
4. Soft State:
5. Due to the lack of immediate consistency, the data values may change over time.
6. Eventually Consistent:
7. The fact that BASE does not obligates immediate consistency but it does not
mean that it never achieves it.
8. However, until it does, the data reads are still possible (even though they might
not reflect reality).
S. No Criteria ACID BASE
1. Simplicity Simple Complex
2. Focus Commits Best attempt
3. Maintenance High Low
4. Consistency Of Data Strong Weak/Loose
5. Concurrency scheme Nested Transactions Close to answer
6. Scaling Vertical Horizontal
7. Implementation Easy to implement Difficult to implement
8. Upgrade Harder to upgrade Easy to upgrade
9. Type of database Robust Simple
10. Type of code Simple Harder
11. Time required for completion Less time More time.
12. Examples Oracle, MySQL, SQL Server, etc.
DynamoDB, Cassandra, CouchDB,
SimpleDB etc.
ACID vs BASE
CAP Theorem
What is the CAP theorem?
• The CAP Theorem is comprised of three components
(hence its name) as they relate to distributed data stores:
• Consistency. All reads receive the most recent write or an
error.
• Availability. All reads contain data, but it might not be the
most recent.
• Partition Tolerance. The system continues to operate
despite network failures (i.e.; dropped partitions, slow
network connections, or unavailable network connections
between nodes.)
NoSQL Database
• NoSQL databases do not require a schema, and don’t enforce relations between tables.
• All its documents are JSON documents, which are complete entities one can readily read and understand.
• They are widely recognized for:
• Ease-of-use
• Scalable performance
• Strong resilience
• Wide availability
Examples of NoSQL databases include:
• Cloud Firestore
• Firebase Real-time DB
• MongoDB
• MarkLogic
• Couchbase
• CloudDB
• Amazon DynamoDB
NoSQL Database Types
SQL Vs NoSQL Database
Thank you

More Related Content

Similar to nosql [Autosaved].pptx

Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
AshishRathore72
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
Mohan Rathour
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDB
Carlo Vaccari
 
No SQL - MongoDB
No SQL - MongoDBNo SQL - MongoDB
No SQL - MongoDB
Mirza Asif
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
Dhrubaji Mandal ♛
 
Beginner's guide to Mongodb and NoSQL
Beginner's guide to Mongodb and NoSQL  Beginner's guide to Mongodb and NoSQL
Beginner's guide to Mongodb and NoSQL
Maulin Shah
 
Unit-10.pptx
Unit-10.pptxUnit-10.pptx
Unit-10.pptx
GhanashyamBK1
 
Elasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparisonElasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparison
jeetendra mandal
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
Tariqul islam
 
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYCHands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Laura Ventura
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
Rajesh Kumar
 
A Study on Mongodb Database.pdf
A Study on Mongodb Database.pdfA Study on Mongodb Database.pdf
A Study on Mongodb Database.pdf
Jessica Navarro
 
A Study on Mongodb Database
A Study on Mongodb DatabaseA Study on Mongodb Database
A Study on Mongodb Database
IJSRD
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
Carlos Alberto Benitez
 

Similar to nosql [Autosaved].pptx (20)

Introduction to MongoDB and its best practices
Introduction to MongoDB and its best practicesIntroduction to MongoDB and its best practices
Introduction to MongoDB and its best practices
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDB
 
express.pptx
express.pptxexpress.pptx
express.pptx
 
No SQL - MongoDB
No SQL - MongoDBNo SQL - MongoDB
No SQL - MongoDB
 
Mongo db dhruba
Mongo db dhrubaMongo db dhruba
Mongo db dhruba
 
Beginner's guide to Mongodb and NoSQL
Beginner's guide to Mongodb and NoSQL  Beginner's guide to Mongodb and NoSQL
Beginner's guide to Mongodb and NoSQL
 
Unit-10.pptx
Unit-10.pptxUnit-10.pptx
Unit-10.pptx
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
No sql database
No sql databaseNo sql database
No sql database
 
Elasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparisonElasticsearch vs MongoDB comparison
Elasticsearch vs MongoDB comparison
 
NOSQL and MongoDB Database
NOSQL and MongoDB DatabaseNOSQL and MongoDB Database
NOSQL and MongoDB Database
 
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYCHands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
Hands on Big Data Analysis with MongoDB - Cloud Expo Bootcamp NYC
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
A Study on Mongodb Database.pdf
A Study on Mongodb Database.pdfA Study on Mongodb Database.pdf
A Study on Mongodb Database.pdf
 
A Study on Mongodb Database
A Study on Mongodb DatabaseA Study on Mongodb Database
A Study on Mongodb Database
 
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDBMongoDB.local Sydney: An Introduction to Document Databases with MongoDB
MongoDB.local Sydney: An Introduction to Document Databases with MongoDB
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
express.pdf
express.pdfexpress.pdf
express.pdf
 

Recently uploaded

哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
ukgaet
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
nscud
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Subhajit Sahu
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
Oppotus
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
NABLAS株式会社
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
theahmadsaood
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
ewymefz
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
axoqas
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 
Tabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflowsTabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflows
alex933524
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 

Recently uploaded (20)

哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
 
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
一比一原版(UofM毕业证)明尼苏达大学毕业证成绩单
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
 
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
Algorithmic optimizations for Dynamic Levelwise PageRank (from STICD) : SHORT...
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
【社内勉強会資料_Octo: An Open-Source Generalist Robot Policy】
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单一比一原版(NYU毕业证)纽约大学毕业证成绩单
一比一原版(NYU毕业证)纽约大学毕业证成绩单
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
做(mqu毕业证书)麦考瑞大学毕业证硕士文凭证书学费发票原版一模一样
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 
Tabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflowsTabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflows
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 

nosql [Autosaved].pptx

  • 2. NoSQL  Semi-structured data is also an important element of many NoSQL  (“not only SQL”) databases.  NoSQL databases differ from relational databases because they do not separate the organization (schema) from the data.  This makes NoSQL a better choice to store information that does not easily fit into the record and table format, such as text with varying lengths.  It also allows for easier data exchange between databases.  Some newer NoSQL databases like MongoDB and Couchbase also incorporate semi-structured documents by natively storing them in the JSON format. Prof.Indrani Sen MCA,MPhil Computer Science
  • 3. What is NoSQL Database?  NoSQL databases basically called as Not Only SQL database.  These databases are non-relational database systems used for storing and retrieving data.  Nowadays NoSQL Databases are predominantly utilized as real-time based web applications.  NoSQL databases can therefore be called as Big Data databases or Cloud databases.  NoSQL Databases are faster in compared to SQL Databases and thus it makes major part of Data applications. Prof.Indrani Sen MCA,MPhil Computer Science
  • 4.  Database design in relational models uses primary and foreign keys and follows strict constraints when the tables are created.  The main motto of NoSQL is that the relational databases are good for smaller data storage requirements,  but “big data” are mostly used to manage large queries.  To properly manage big data queries NoSQL databases are appropriate which work differently than the relational databases. Prof.Indrani Sen MCA,MPhil Computer Science
  • 5. NoSQL features Result Big Data types Structured, unstructured and semi-structured Scalability Excellent Biggest NoSQL advantages Large volumes of data, dynamic schemas, replication, auto- sharding Prof.Indrani Sen MCA,MPhil Computer Science
  • 6. Why are NoSQL Databases so popular?  Elastic scalability – These databases are highly scalable and allow adding more hardware.  These are implemented to increase customers and provide service as per there requirement.  Architecture based – Lesser failures or system downtimes as these are continuously available for business- critical applications.  Linear-scale performance – These are linearly scalable which increase the throughput of system which is directly proportional to the number of nodes in the cluster. Therefore it helps to maintain a quick response time.  Flexibility in data maintenance – The data storage includes: structured, semi-structured, and unstructured.  The changes are done as per our requirements.  Easy data distribution – Distribution of data can be replicated across multiple data centers.  Fast writes – These databases are designed to run on cheap commodity hardware. They perform write operations in blazingly fast speed and store hundreds of terabytes of data, without affecting the read efficiency. Prof.Indrani Sen MCA,MPhil Computer Science
  • 8. CouchDB  CouchDB is an Open Source NoSQL Database based on JSON to stores data and JavaScript in the form of query language.  CouchDB is a multi-version controlling system for avoiding the blockage of the DB file scripting.  It has been ranked as the best database in the year 2016 on the basis of its highest popularity among all the NoSQL Databases. Prof.Indrani Sen MCA,MPhil Computer Science
  • 9. MongoDB  MongoDB is the most popular among NoSQL Databases which is a free and open- source document-oriented database program.  It is a scalable and accessible database.  It is prescribed in C++ but uses JSON-like documents with schemas as JavaScript can be utilized as the query language.  MongoDB scales horizontally which is preferable in JavaScript frameworks. Prof.Indrani Sen MCA,MPhil Computer Science
  • 10. Cassandra  Cassandra is a distributed data storage system from Apache for handling very large amounts of structured data and highly scalable.  Essentially, these data are widely used across many commodity servers, providing high availability with no failure till now.  It gives you the maximal flexibility for distribution of data.  It allows adding data storage to your service online and makes your task much easier.  There is no scope for complex configuration as all the nodes in a cluster are same.  Cassandra is java based programming language which supports MapReduce on Apache Hadoop.  Cassandra Query Language (CQL) is an SQL-like language for querying Cassandra Database. Prof.Indrani Sen MCA,MPhil Computer Science
  • 12. Properties  One such approach is the property graph model, where data is organized as nodes, relationships, and properties  (data stored on the nodes or relationships).  Nodes are the entities in the graph.  They can hold any number of attributes (key-value pairs) called properties.  Nodes can be tagged with labels, representing their different roles in your domain.  Relationships provide directed, named, semantically-relevant connections between two node entities (e.g. Member ISSUE_RETURN Book). Prof.Indrani Sen MCA,MPhil Computer Science
  • 13. Prof.Indrani Sen MCA,MPhil Computer Science
  • 14. MongoDB MONGODB IS A CROSS-PLATFORM, DOCUMENT ORIENTED DATABASE THAT PROVIDES, HIGH PERFORMANCE, HIGH AVAILABILITY, AND EASY SCALABILITY. MONGODB WORKS ON CONCEPT OF COLLECTION AND DOCUMENT.
  • 15.
  • 18. Use your windows UserId and password( if password is not there you have to create)
  • 19. If you are installing as a network service uncheck this in windows 10
  • 20. Install the interface Download Studio 3T for MongoDB | Windows, macOS & Linux
  • 21.
  • 22.
  • 23. Creating database  The use Command  MongoDB  use DATABASE_NAME is used to create database. The command will create a new database if it doesn't exist, otherwise it will return the existing database.
  • 25. To list databases  >show dbs  local 0.78125GB  mydb 0.23012GB  test 0.23012GB
  • 26. Deleting database  The dropDatabase() Method  db.dropDatabase() command is used to drop a existing database.  Syntax  db.dropDatabase()  This will delete the selected database.  If you have not selected any database, then it will delete default 'test' database.
  • 27. Collections  MongoDB stores documents in collections.  Collections are analogous to tables in relational databases.  Create a Collection  If a collection does not exist, MongoDB creates the collection when you first store data for that collection
  • 28. Creating collection  The createCollection() Method  MongoDB db.createCollection(name, options) is used to create collection.  Syntax  db.createCollection(name, options) In the command, name is name of collection to be created. Options is a document and is used to specify configuration of collection likememory size etc.
  • 29. List collections  >db.createCollection("mycollection")  using the command show collections.  >show collections  In MongoDB, you don't need to create collection. MongoDB creates collection automatically, when you insert some document.
  • 30. Documents  A record in MongoDB is a document, which is a data structure composed of field and value pairs.  MongoDB documents are similar to JavaScript Object Notation objects but use a variant called Binary JSON (BSON) that accommodates more data types.  The fields in documents are akin to the columns in a relational database, and the values they contain can be a variety of data types,  including other documents, arrays and arrays of documents  Documents, which also must incorporate a primary key as a unique identifier, are the basic unit of data in MongoDB.  Collections contain sets of documents and function as the equivalent of relational database tables.  Collections can contain any type of data, but the restriction is the data in a collection cannot be spread across different databases.
  • 31.
  • 32.
  • 33. Advantages of mongodb  Flexible schema  No need of joins  Faster queries  Document based model  Efficient for Haddoop implementation Prof.Indrani Sen MCA,MPhil Computer Science
  • 35. Database  Database is a physical container for collections. Each database gets its own set of files on the file system.  A single MongoDB server typically has multiple databases. Prof.Indrani Sen MCA,MPhil Computer Science
  • 36. Collection  Collection is a group of MongoDB documents.  It is the equivalent of an RDBMS table.  A collection exists within a single database.  Collections do not enforce a schema.  Documents within a collection can have different fields.  Typically, all documents in a collection are of similar or related purpose. Prof.Indrani Sen MCA,MPhil Computer Science
  • 37. Prof.Indrani Sen MCA,MPhil Computer Science  [Recipe_details  {recipe_id ,  Name:Lucknowi Mutton Biryani,  summary:Lucknowi Mutton Biryani is a very popular North Indian recipe. It is different from the basic biryanis as it come straight from the Nawabs and is the soul of every party. It is made from cashewnut paste, saffron, curd, star anise and mace powder that give it an amazing flavour. In this delightful recipe, the process of marination is very important. The longer you marinate the meat, the better is the taste of the biryani. It is also important to soak the rice in water for sometime,  date_publish: 2017-05-15T15:45:37+05:30  category:Main  Cuisine:Awadhi  preptime:PT15M  Tottime:PT40M  Yield:4 Servings
  • 38. MongoDB  [Recipe_details {recipe_id , title,summary,author, date_publish,category,cuisine,preptime,cooktime, yield,ingredient_list,instruction_list,  [recipe_qty{ qty,unit,Ingredient_name, ref_id_list{ingredient_name , feature_list,category} ]  Instruction[ {method_name, time, tool, [Ingredient{ingredient_name , feature_list ,category} ]  }] Prof.Indrani Sen MCA,MPhil Computer Science
  • 39. Library database Prof.Indrani Sen MCA,MPhil Computer Science
  • 40. Transactions  Transactions in a database environment have two main purposes:-  Reliability of data: In case of unpredictable circumstances such as power failures or system failures while a database is getting updated or being read,  the transactions should ensure to give us consistent and accurate data.  Concurrent Access of data:When more than one user or application programs are trying to access the same data,  the transactions should provide isolation between the programs accessing a database concurrently.  Otherwise concurrent read or write operations to a database may lead to inconsistent or erronaeous data.
  • 41. Phases of transaction  Begin the transaction.  Execute a set of data manipulations and/or queries.  If no errors occur then commit the transaction and end it.  If errors occur then rollback the transaction and end it.
  • 42. Atomicity  A transaction is an atomic unit of processing;  it is either performed in its entirety or not performed at all.  The atomicity property requires that we execute a transaction to completion.  It is the responsibility of the recovery subsystem of a DBMS to ensure atomicity.  If a transaction fails to complete for some reason, such as a system crash in the midst of transaction execution,  the recovery technique must undo any effects of the transaction on the database.
  • 43. ATM(withdrawal) Database Recovery Manager Account_Balance = Account_Balance - Withdraw _amt Account debited Crash/Transaction Error Transaction rollback Account_Balance= Account_Balance + Withdraw _amt Account credited/ reversed
  • 44. Consistency preservation:  The DBMS has to ensure that the transaction preserves data consistency in a database and does not violate any integrity constraints .  A database program should be written in a way that guarantees that, if the database is in a consistent state before executing the transaction,  it will be in a consistent state after the complete execution of the transaction,  assuming that no interference with other transactions occurs
  • 45.  Consider an account hoder tries to withdraw an amount from his Account where withdraw_amt is greater than the balance,  then the transaction should not cause a change in the database as the action will violate a constraint in the database .  So the DBMS programmers must ensure that such a constraint should exist which will not allow the database to go in an inconsistent state.  A Bank employee tries to open an Account with the same Account_no which already has been assigned to another Account holder,  in this case the transaction should ensure that the Account_no should not be duplicated and hence maintain database integrity.
  • 46.
  • 47. Isolation:  A transaction should appear as though it is being executed in isolation from other transactions.  That is, the execution of a transaction should not be interfered with by any other transactions executing concurrently.
  • 48.
  • 49. Durability or permanency  The changes applied to the database by a committed transaction must be permanent in the database.  These changes must not be lost because of any failure.  For example ,Consider the Account_holder is transferring funds from Account A to Account B then under the following conditions,  the changes should be permanent and cannot be reversed  even if the application crashes  or an error occurs  or the user decides to cancel the transaction after the transaction is over
  • 50. Some Transaction Primitives Examples of primitives for transactions. Primitive Description BEGIN_TRANSACTION Make the start of a transaction END_TRANSACTION Terminate the transaction and try to commit ABORT_TRANSACTION Kill the transaction and restore the old values READ Read data from a file, a table, etc. WRITE Write data to a file, a table, etc.
  • 51. Base Model:  The rise in popularity of NoSQL databases provided a flexible and fluidity with ease to manipulate data and as a result,  a new database model was designed, reflecting these properties.  The acronym BASE is slightly more confusing than ACID but however, the words behind it suggest ways in which the BASE model is different
  • 52. BASE 1. Basically Available: 2. Instead of making it compulsory for immediate consistency, 3. BASE-modelled NoSQL databases will ensure the availability of data by spreading and replicating it across the nodes of the database cluster. 4. Soft State: 5. Due to the lack of immediate consistency, the data values may change over time. 6. Eventually Consistent: 7. The fact that BASE does not obligates immediate consistency but it does not mean that it never achieves it. 8. However, until it does, the data reads are still possible (even though they might not reflect reality).
  • 53. S. No Criteria ACID BASE 1. Simplicity Simple Complex 2. Focus Commits Best attempt 3. Maintenance High Low 4. Consistency Of Data Strong Weak/Loose 5. Concurrency scheme Nested Transactions Close to answer 6. Scaling Vertical Horizontal 7. Implementation Easy to implement Difficult to implement 8. Upgrade Harder to upgrade Easy to upgrade 9. Type of database Robust Simple 10. Type of code Simple Harder 11. Time required for completion Less time More time. 12. Examples Oracle, MySQL, SQL Server, etc. DynamoDB, Cassandra, CouchDB, SimpleDB etc. ACID vs BASE
  • 54. CAP Theorem What is the CAP theorem? • The CAP Theorem is comprised of three components (hence its name) as they relate to distributed data stores: • Consistency. All reads receive the most recent write or an error. • Availability. All reads contain data, but it might not be the most recent. • Partition Tolerance. The system continues to operate despite network failures (i.e.; dropped partitions, slow network connections, or unavailable network connections between nodes.)
  • 55. NoSQL Database • NoSQL databases do not require a schema, and don’t enforce relations between tables. • All its documents are JSON documents, which are complete entities one can readily read and understand. • They are widely recognized for: • Ease-of-use • Scalable performance • Strong resilience • Wide availability Examples of NoSQL databases include: • Cloud Firestore • Firebase Real-time DB • MongoDB • MarkLogic • Couchbase • CloudDB • Amazon DynamoDB
  • 57. SQL Vs NoSQL Database