SlideShare a Scribd company logo
1 of 18
NoSQL: MongoDB
Mirza Asif
What is NoSQL
 In the past few years, the”one size fits all“-thinking concerning data
  stores has been questioned by both, Science and web companies,
  which has lead to the emergence of a great variety of alternative
  databases. The movement as well as the new datastores is
  commonly subsumed under the term NoSQL.


 The basic quality of NoSQL is that, it may not require fixed table
  schemas, usually avoid join operations, and typically scale
  horizontally. Academic researchers typically refer to these databases
  as structured storage, a term that includes classic relational
  databases as a subset.


 NoSQL database also trades off “ACID” (atomicity, consistency,
  isolation and durability). NoSQL databases, to varying degrees,
  even allow for the schema of data to differ from record to record. If
  there doesn’t exist schema or a table in NoSQL, then how do you
  visualize the database structure? Well here is the answer
NoSQL Features
 No schema required: Data can be inserted in a NoSQL
  database without first defining a rigid database schema. As
  a corollary, the format of the data being inserted can be
  changed at any time, without application disruption. This
  provides immense application flexibility, which ultimately
  delivers substantial business flexibility.


 Auto elasticity: NoSQL automatically spreads your data
  onto multiple servers without requiring application
  assistance. Servers can be added or removed from the data
  layer without application downtime.


 Integrated caching: In order to increase data through and
  increase the performance advance NoSQL techniques cache
  data in system memory. This is in contrast to SQL database
  where this has to be done using separate infrastructure.
Types of NoSQL
Describing the architecture of data storage in NoSQL, there are three
types of popular NoSQL databases.


 Key-value stores. As the name implies, a key-value store is a
  system that stores values indexed for retrieval by keys. These
  systems can hold structured or unstructured data.


 Column- oriented databases. Rather than store sets of
  information in a heavily structured table of columns and rows with
  uniform sized fields for each record, as is the case with relational
  databases, column-oriented databases contain one extendable
  column of closely related data.


 document-based stores. These databases store and organize data
  as collections of documents, rather than as structured tables with
  uniform sized fields for each record. With these databases, users
  can add any number of fields of any length to a document.
Advantages of NoSQL

 NoSQL databases generally process data faster than
  relational databases.


 NoSQL databases are also often faster because their
  data models are simpler.


 Major NoSQL systems are flexible enough to better
  enable developers to use the applications in ways that
  meet their needs.
MongoDB



 MongoDB (from "humongous") is a scalable, high-
  performance, open source, document-oriented database.
  Written in C++.


 It stores data as BSON format (Binary JSON)
Some basic terms


MySQL term            Mongo term
database              database
table                 collection
index                 index
row                   BSON document
column                BSON field
join                  embedding and linking
primary key           _id field
Some Question
 When do we embed data versus linking?


 How many collections do we have, and what are they?


 When do we need atomic operations?


 What indexes will we create to make query and updates
  fast?


 What is shard?
Best Practices
 "First class" objects, that are at top level, typically have
  their own collection.


 Line item detail objects typically are embedded.


 Objects which follow an object modeling "contains"
  relationship should generally be embedded.


 Many to many relationships are generally done by
  linking.
Best Practices

 Collections with only a few objects may safely exist as
  separate collections, as the whole collection is quickly
  cached in application server memory.


 Embedded objects are a bit harder to link to than "top level"
  objects in collections.


 If the amount of data to embed is huge (many megabytes),
  you may reach the limit on size of a single object, which is
  16 MB per document. If you need more than that see
  GridFS.


 If performance is an issue, embed
How to Index
 A second aspect of schema design is index selection. As
  a general rule, where you want an index in a relational
  database, you want an index in Mongo.


 The _id field is automatically indexed.


 Fields upon which keys are looked up should be indexed.


 Sort fields generally should be indexed.
How to Index

 The MongoDB profiling facility provides useful
  information for where an index should be added that is
  missing.


 Note that adding an index slows writes to a collection,
  but not reads. Use lots of indexes for collections with a
  high read : write ratio (assuming one does not mind the
  storage overage). For collections with more writes than
  reads, indexes are expensive as keys must be added to
  each index for each insert.
Atomic Operations


 Some problems require the ability to perform atomic
  operations. For example, simply incrementing a counter
  is often a case where one wants atomicity. MongoDB can
  also perform more complex operations such as that
  shown in the pseudocode below:


 atomically { if( doc.credits > 5 ) { doc.credits -= 5;
  doc.debits += 5; } }
Atomic Operations

 Another example would be a user registration scenario.
  We would never want to users to register the same
  username simultaneously:


 atomically { if( exists a document with username='jane'
  ) { print "username already in use please choose
  another"; } else { insert a document with
  username='jane' in the users collection; print("thanks
  you have registered as user jane."); } }
What is Sharding?

MongoDB scales horizontally via an auto-sharding
(partitioning) architecture.


 Horizontal partitioning splits one or more tables by
  row, usually within a single instance of a schema and a
  database server.
 Sharding goes beyond this: it partitions the problematic
  table(s) in the same way, but it does this across
  potentially multiple instances of the schema.
Sharding


Sharding offers:
 Automatic balancing for changes in load and data
  distribution
 Easy addition of new machines
 Scaling out to one thousand nodes
 No single points of failure
 Automatic failover
Sharding
 Another consideration for schema design is sharding. A
  BSON document (which may have significant amounts of
  embedding) resides on one and only one shard.


 A collection may be sharded. When sharded, the
  collection has a shard key, which determines how the
  collection is partitioned among shards. Typically (but not
  always) queries on a sharded collection involve the
  shard key as part of the query expression.


 The key here is that changing shard keys is difficult. You
  will want to choose the right key from the start(which is
  not covered in this presentation).
Question?

More Related Content

What's hot

NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
 
Mongo db a deep dive of mongodb indexes
Mongo db  a deep dive of mongodb indexesMongo db  a deep dive of mongodb indexes
Mongo db a deep dive of mongodb indexesRajesh Kumar
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsnehabsairam
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMohan Rathour
 
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortals
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortalsChapter 4 terminolgy of keyvalue databses from nosql for mere mortals
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortalsnehabsairam
 
Analysis on NoSQL: MongoDB Tool
Analysis on NoSQL: MongoDB ToolAnalysis on NoSQL: MongoDB Tool
Analysis on NoSQL: MongoDB Toolijtsrd
 
Vskills Apache Cassandra sample material
Vskills Apache Cassandra sample materialVskills Apache Cassandra sample material
Vskills Apache Cassandra sample materialVskills
 
NoSQL with ASP.NET MVC
NoSQL with ASP.NET MVCNoSQL with ASP.NET MVC
NoSQL with ASP.NET MVCManoj Bandara
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sqlRam kumar
 
Chapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsChapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsnehabsairam
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageBethmi Gunasekara
 

What's hot (20)

NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
 
Introduction to NoSQL
Introduction to NoSQLIntroduction to NoSQL
Introduction to NoSQL
 
Mongo db a deep dive of mongodb indexes
Mongo db  a deep dive of mongodb indexesMongo db  a deep dive of mongodb indexes
Mongo db a deep dive of mongodb indexes
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
 
Chapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortalsChapter 7(documnet databse termininology) no sql for mere mortals
Chapter 7(documnet databse termininology) no sql for mere mortals
 
Mongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorialMongo Bb - NoSQL tutorial
Mongo Bb - NoSQL tutorial
 
Unit 3 MongDB
Unit 3 MongDBUnit 3 MongDB
Unit 3 MongDB
 
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortals
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortalsChapter 4 terminolgy of keyvalue databses from nosql for mere mortals
Chapter 4 terminolgy of keyvalue databses from nosql for mere mortals
 
Key-Value NoSQL Database
Key-Value NoSQL DatabaseKey-Value NoSQL Database
Key-Value NoSQL Database
 
Document Database
Document DatabaseDocument Database
Document Database
 
Analysis on NoSQL: MongoDB Tool
Analysis on NoSQL: MongoDB ToolAnalysis on NoSQL: MongoDB Tool
Analysis on NoSQL: MongoDB Tool
 
Vskills Apache Cassandra sample material
Vskills Apache Cassandra sample materialVskills Apache Cassandra sample material
Vskills Apache Cassandra sample material
 
NoSQL with ASP.NET MVC
NoSQL with ASP.NET MVCNoSQL with ASP.NET MVC
NoSQL with ASP.NET MVC
 
MongoDB-SESION01
MongoDB-SESION01MongoDB-SESION01
MongoDB-SESION01
 
Nosql databases
Nosql databasesNosql databases
Nosql databases
 
Non relational databases-no sql
Non relational databases-no sqlNon relational databases-no sql
Non relational databases-no sql
 
Chapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortalsChapter 5 design of keyvalue databses from nosql for mere mortals
Chapter 5 design of keyvalue databses from nosql for mere mortals
 
No sql
No sqlNo sql
No sql
 
Database and types of database
Database and types of databaseDatabase and types of database
Database and types of database
 
No SQL- The Future Of Data Storage
No SQL- The Future Of Data StorageNo SQL- The Future Of Data Storage
No SQL- The Future Of Data Storage
 

Viewers also liked

Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...
Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...
Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...Kelly Quattlebaum
 
T Mi Re April 2010 Us Edition
T Mi Re April 2010 Us EditionT Mi Re April 2010 Us Edition
T Mi Re April 2010 Us Editionpdrury
 
A novel approach for preventing black hole
A novel approach for preventing black holeA novel approach for preventing black hole
A novel approach for preventing black holeijasa
 
Results presentation 4 q09
Results presentation 4 q09Results presentation 4 q09
Results presentation 4 q09comgasri
 
Selected graphs from the European Works Councils database, December 2014
Selected graphs from the European Works Councils database, December 2014Selected graphs from the European Works Councils database, December 2014
Selected graphs from the European Works Councils database, December 2014Irmgard Pas
 
Pentesting embedded
Pentesting embeddedPentesting embedded
Pentesting embeddedantitree
 
왕실경호비금생법
왕실경호비금생법왕실경호비금생법
왕실경호비금생법청시 김
 
Debut Presentation Rsc Jisc Forum Dec 08
Debut Presentation Rsc Jisc Forum Dec 08Debut Presentation Rsc Jisc Forum Dec 08
Debut Presentation Rsc Jisc Forum Dec 08HAROLDFRICKER
 
På sporet efter hinanden - Web 2.0 og social navigation
På sporet efter hinanden - Web 2.0 og social navigationPå sporet efter hinanden - Web 2.0 og social navigation
På sporet efter hinanden - Web 2.0 og social navigationLennart Björneborn
 
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...anusheel nahar
 

Viewers also liked (18)

Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...
Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...
Digital Atlanta | Executive Branding with Social Media | Social Media Trainer...
 
Res. 225 2009 indecopi-cus
Res. 225 2009 indecopi-cusRes. 225 2009 indecopi-cus
Res. 225 2009 indecopi-cus
 
T Mi Re April 2010 Us Edition
T Mi Re April 2010 Us EditionT Mi Re April 2010 Us Edition
T Mi Re April 2010 Us Edition
 
A novel approach for preventing black hole
A novel approach for preventing black holeA novel approach for preventing black hole
A novel approach for preventing black hole
 
Education2.0 Picnic
Education2.0 PicnicEducation2.0 Picnic
Education2.0 Picnic
 
Financial statements
Financial statementsFinancial statements
Financial statements
 
Stats final stuff
Stats final stuffStats final stuff
Stats final stuff
 
Lecture 19-cs648
Lecture 19-cs648Lecture 19-cs648
Lecture 19-cs648
 
International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)International Journal of Engineering Inventions (IJEI)
International Journal of Engineering Inventions (IJEI)
 
SeaRecovery_brochure2013
SeaRecovery_brochure2013SeaRecovery_brochure2013
SeaRecovery_brochure2013
 
Results presentation 4 q09
Results presentation 4 q09Results presentation 4 q09
Results presentation 4 q09
 
Selected graphs from the European Works Councils database, December 2014
Selected graphs from the European Works Councils database, December 2014Selected graphs from the European Works Councils database, December 2014
Selected graphs from the European Works Councils database, December 2014
 
2013.05 - IASSIST 2013 - 2
2013.05 - IASSIST 2013 - 22013.05 - IASSIST 2013 - 2
2013.05 - IASSIST 2013 - 2
 
Pentesting embedded
Pentesting embeddedPentesting embedded
Pentesting embedded
 
왕실경호비금생법
왕실경호비금생법왕실경호비금생법
왕실경호비금생법
 
Debut Presentation Rsc Jisc Forum Dec 08
Debut Presentation Rsc Jisc Forum Dec 08Debut Presentation Rsc Jisc Forum Dec 08
Debut Presentation Rsc Jisc Forum Dec 08
 
På sporet efter hinanden - Web 2.0 og social navigation
På sporet efter hinanden - Web 2.0 og social navigationPå sporet efter hinanden - Web 2.0 og social navigation
På sporet efter hinanden - Web 2.0 og social navigation
 
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
Velocity Estimation from noisy Measurements-Sensor fusion using modified Kalm...
 

Similar to No SQL - MongoDB

MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data sciencebitragowthamkumar1
 
Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...ijdms
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptxIndrani Sen
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql DatabasePrashant Gupta
 
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptxRushikeshChikane2
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxRoopaR36
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDBCarlo Vaccari
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfajajkhan16
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...ijcsity
 
Choosing your NoSQL storage
Choosing your NoSQL storageChoosing your NoSQL storage
Choosing your NoSQL storageImteyaz Khan
 

Similar to No SQL - MongoDB (20)

Mongo db
Mongo dbMongo db
Mongo db
 
MongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data scienceMongoDB Lab Manual (1).pdf used in data science
MongoDB Lab Manual (1).pdf used in data science
 
the rising no sql technology
the rising no sql technologythe rising no sql technology
the rising no sql technology
 
No sql - { If and Else }
No sql - { If and Else }No sql - { If and Else }
No sql - { If and Else }
 
Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...Comparative study of no sql document, column store databases and evaluation o...
Comparative study of no sql document, column store databases and evaluation o...
 
nosql [Autosaved].pptx
nosql [Autosaved].pptxnosql [Autosaved].pptx
nosql [Autosaved].pptx
 
Mongodb - NoSql Database
Mongodb - NoSql DatabaseMongodb - NoSql Database
Mongodb - NoSql Database
 
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
3.Implementation with NOSQL databases Document Databases (Mongodb).pptx
 
No sq lv2
No sq lv2No sq lv2
No sq lv2
 
Unit-10.pptx
Unit-10.pptxUnit-10.pptx
Unit-10.pptx
 
NoSQL Basics and MongDB
NoSQL Basics and  MongDBNoSQL Basics and  MongDB
NoSQL Basics and MongDB
 
NoSQL Databases
NoSQL DatabasesNoSQL Databases
NoSQL Databases
 
mongodb11 (1) (1).pptx
mongodb11 (1) (1).pptxmongodb11 (1) (1).pptx
mongodb11 (1) (1).pptx
 
Klevis Mino: MongoDB
Klevis Mino: MongoDBKlevis Mino: MongoDB
Klevis Mino: MongoDB
 
NOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdfNOSQL in big data is the not only structure langua.pdf
NOSQL in big data is the not only structure langua.pdf
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
MONGODB VS MYSQL: A COMPARATIVE STUDY OF PERFORMANCE IN SUPER MARKET MANAGEME...
 
No sql database
No sql databaseNo sql database
No sql database
 
Choosing your NoSQL storage
Choosing your NoSQL storageChoosing your NoSQL storage
Choosing your NoSQL storage
 

Recently uploaded

College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service Kolhapur
College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service KolhapurCollege Call Girls Kolhapur Aanya 8617697112 Independent Escort Service Kolhapur
College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service KolhapurCall girls in Ahmedabad High profile
 
23042024_First India Newspaper Jaipur.pdf
23042024_First India Newspaper Jaipur.pdf23042024_First India Newspaper Jaipur.pdf
23042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012ankitnayak356677
 
Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkbhavenpr
 
25042024_First India Newspaper Jaipur.pdf
25042024_First India Newspaper Jaipur.pdf25042024_First India Newspaper Jaipur.pdf
25042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书如何办理(BU学位证书)美国贝翰文大学毕业证学位证书
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书Fi L
 
Israel Palestine Conflict, The issue and historical context!
Israel Palestine Conflict, The issue and historical context!Israel Palestine Conflict, The issue and historical context!
Israel Palestine Conflict, The issue and historical context!Krish109503
 
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...narsireddynannuri1
 
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...AlexisTorres963861
 
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptx
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptxKAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptx
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptxjohnandrewcarlos
 
26042024_First India Newspaper Jaipur.pdf
26042024_First India Newspaper Jaipur.pdf26042024_First India Newspaper Jaipur.pdf
26042024_First India Newspaper Jaipur.pdfFIRST INDIA
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerOmarCabrera39
 
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsVashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsPooja Nehwal
 
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptx
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptxLorenzo D'Emidio_Lavoro sullaNorth Korea .pptx
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptxlorenzodemidio01
 
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...Ismail Fahmi
 
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docxkfjstone13
 
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Axel Bruns
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victoryanjanibaddipudi1
 
Minto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxMinto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxAwaiskhalid96
 
Roberts Rules Cheat Sheet for LD4 Precinct Commiteemen
Roberts Rules Cheat Sheet for LD4 Precinct CommiteemenRoberts Rules Cheat Sheet for LD4 Precinct Commiteemen
Roberts Rules Cheat Sheet for LD4 Precinct Commiteemenkfjstone13
 

Recently uploaded (20)

College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service Kolhapur
College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service KolhapurCollege Call Girls Kolhapur Aanya 8617697112 Independent Escort Service Kolhapur
College Call Girls Kolhapur Aanya 8617697112 Independent Escort Service Kolhapur
 
23042024_First India Newspaper Jaipur.pdf
23042024_First India Newspaper Jaipur.pdf23042024_First India Newspaper Jaipur.pdf
23042024_First India Newspaper Jaipur.pdf
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012
 
Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpk
 
25042024_First India Newspaper Jaipur.pdf
25042024_First India Newspaper Jaipur.pdf25042024_First India Newspaper Jaipur.pdf
25042024_First India Newspaper Jaipur.pdf
 
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书如何办理(BU学位证书)美国贝翰文大学毕业证学位证书
如何办理(BU学位证书)美国贝翰文大学毕业证学位证书
 
Israel Palestine Conflict, The issue and historical context!
Israel Palestine Conflict, The issue and historical context!Israel Palestine Conflict, The issue and historical context!
Israel Palestine Conflict, The issue and historical context!
 
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
Nurturing Families, Empowering Lives: TDP's Vision for Family Welfare in Andh...
 
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
Defensa de JOH insiste que testimonio de analista de la DEA es falso y solici...
 
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptx
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptxKAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptx
KAHULUGAN AT KAHALAGAHAN NG GAWAING PANSIBIKO.pptx
 
26042024_First India Newspaper Jaipur.pdf
26042024_First India Newspaper Jaipur.pdf26042024_First India Newspaper Jaipur.pdf
26042024_First India Newspaper Jaipur.pdf
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert Oppenheimer
 
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call GirlsVashi Escorts, {Pooja 09892124323}, Vashi Call Girls
Vashi Escorts, {Pooja 09892124323}, Vashi Call Girls
 
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptx
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptxLorenzo D'Emidio_Lavoro sullaNorth Korea .pptx
Lorenzo D'Emidio_Lavoro sullaNorth Korea .pptx
 
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
HARNESSING AI FOR ENHANCED MEDIA ANALYSIS A CASE STUDY ON CHATGPT AT DRONE EM...
 
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx
2024 04 03 AZ GOP LD4 Gen Meeting Minutes FINAL.docx
 
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
Dynamics of Destructive Polarisation in Mainstream and Social Media: The Case...
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
 
Minto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptxMinto-Morley Reforms 1909 (constitution).pptx
Minto-Morley Reforms 1909 (constitution).pptx
 
Roberts Rules Cheat Sheet for LD4 Precinct Commiteemen
Roberts Rules Cheat Sheet for LD4 Precinct CommiteemenRoberts Rules Cheat Sheet for LD4 Precinct Commiteemen
Roberts Rules Cheat Sheet for LD4 Precinct Commiteemen
 

No SQL - MongoDB

  • 2. What is NoSQL  In the past few years, the”one size fits all“-thinking concerning data stores has been questioned by both, Science and web companies, which has lead to the emergence of a great variety of alternative databases. The movement as well as the new datastores is commonly subsumed under the term NoSQL.  The basic quality of NoSQL is that, it may not require fixed table schemas, usually avoid join operations, and typically scale horizontally. Academic researchers typically refer to these databases as structured storage, a term that includes classic relational databases as a subset.  NoSQL database also trades off “ACID” (atomicity, consistency, isolation and durability). NoSQL databases, to varying degrees, even allow for the schema of data to differ from record to record. If there doesn’t exist schema or a table in NoSQL, then how do you visualize the database structure? Well here is the answer
  • 3. NoSQL Features  No schema required: Data can be inserted in a NoSQL database without first defining a rigid database schema. As a corollary, the format of the data being inserted can be changed at any time, without application disruption. This provides immense application flexibility, which ultimately delivers substantial business flexibility.  Auto elasticity: NoSQL automatically spreads your data onto multiple servers without requiring application assistance. Servers can be added or removed from the data layer without application downtime.  Integrated caching: In order to increase data through and increase the performance advance NoSQL techniques cache data in system memory. This is in contrast to SQL database where this has to be done using separate infrastructure.
  • 4. Types of NoSQL Describing the architecture of data storage in NoSQL, there are three types of popular NoSQL databases.  Key-value stores. As the name implies, a key-value store is a system that stores values indexed for retrieval by keys. These systems can hold structured or unstructured data.  Column- oriented databases. Rather than store sets of information in a heavily structured table of columns and rows with uniform sized fields for each record, as is the case with relational databases, column-oriented databases contain one extendable column of closely related data.  document-based stores. These databases store and organize data as collections of documents, rather than as structured tables with uniform sized fields for each record. With these databases, users can add any number of fields of any length to a document.
  • 5. Advantages of NoSQL  NoSQL databases generally process data faster than relational databases.  NoSQL databases are also often faster because their data models are simpler.  Major NoSQL systems are flexible enough to better enable developers to use the applications in ways that meet their needs.
  • 6. MongoDB  MongoDB (from "humongous") is a scalable, high- performance, open source, document-oriented database. Written in C++.  It stores data as BSON format (Binary JSON)
  • 7. Some basic terms MySQL term Mongo term database database table collection index index row BSON document column BSON field join embedding and linking primary key _id field
  • 8. Some Question  When do we embed data versus linking?  How many collections do we have, and what are they?  When do we need atomic operations?  What indexes will we create to make query and updates fast?  What is shard?
  • 9. Best Practices  "First class" objects, that are at top level, typically have their own collection.  Line item detail objects typically are embedded.  Objects which follow an object modeling "contains" relationship should generally be embedded.  Many to many relationships are generally done by linking.
  • 10. Best Practices  Collections with only a few objects may safely exist as separate collections, as the whole collection is quickly cached in application server memory.  Embedded objects are a bit harder to link to than "top level" objects in collections.  If the amount of data to embed is huge (many megabytes), you may reach the limit on size of a single object, which is 16 MB per document. If you need more than that see GridFS.  If performance is an issue, embed
  • 11. How to Index  A second aspect of schema design is index selection. As a general rule, where you want an index in a relational database, you want an index in Mongo.  The _id field is automatically indexed.  Fields upon which keys are looked up should be indexed.  Sort fields generally should be indexed.
  • 12. How to Index  The MongoDB profiling facility provides useful information for where an index should be added that is missing.  Note that adding an index slows writes to a collection, but not reads. Use lots of indexes for collections with a high read : write ratio (assuming one does not mind the storage overage). For collections with more writes than reads, indexes are expensive as keys must be added to each index for each insert.
  • 13. Atomic Operations  Some problems require the ability to perform atomic operations. For example, simply incrementing a counter is often a case where one wants atomicity. MongoDB can also perform more complex operations such as that shown in the pseudocode below:  atomically { if( doc.credits > 5 ) { doc.credits -= 5; doc.debits += 5; } }
  • 14. Atomic Operations  Another example would be a user registration scenario. We would never want to users to register the same username simultaneously:  atomically { if( exists a document with username='jane' ) { print "username already in use please choose another"; } else { insert a document with username='jane' in the users collection; print("thanks you have registered as user jane."); } }
  • 15. What is Sharding? MongoDB scales horizontally via an auto-sharding (partitioning) architecture.  Horizontal partitioning splits one or more tables by row, usually within a single instance of a schema and a database server.  Sharding goes beyond this: it partitions the problematic table(s) in the same way, but it does this across potentially multiple instances of the schema.
  • 16. Sharding Sharding offers:  Automatic balancing for changes in load and data distribution  Easy addition of new machines  Scaling out to one thousand nodes  No single points of failure  Automatic failover
  • 17. Sharding  Another consideration for schema design is sharding. A BSON document (which may have significant amounts of embedding) resides on one and only one shard.  A collection may be sharded. When sharded, the collection has a shard key, which determines how the collection is partitioned among shards. Typically (but not always) queries on a sharded collection involve the shard key as part of the query expression.  The key here is that changing shard keys is difficult. You will want to choose the right key from the start(which is not covered in this presentation).