SlideShare a Scribd company logo
1 of 28
Download to read offline
SUBMITTEDBY:
NAME:T.ARIFABEGUM
CLASS:2NDM.SC.,COMPUTERSCIENCE
BATCH:2017–2019
INCHARGESTAFF:MS.M.FLORENCEDAYANA
You can have data without information , but you
cannot have information without data
OUTLINE
 Introduction
 Developmentandimprovement
 Whatismongodb?
 Whymongodb?
 Supportfordynamicqueries
 Storingbinarydata
 Whyreplication?
 Termsusedinrdbmsandmongodb
 Createdatabase
 Dropdatabase
 Datatypesinmongodb
INTRODUCTION
 Therelationaldatabasemodelhasprevailed fordecades.
 ToreplacetherelationalDB,newkindofdatabaseintheenterprisecalled
NoSQL(NOTONLYSQL).
 MongoDBisanopen-sourcedocument-baseddatabasemanagementtool
thatstoresdatainJSON-likeformats.
 Itisahighlyscalable,flexibleanddistributedNoSQLdatabase.
DEVELOPMENTANDIMPROVEMENT
 10gensoftwarecompanybegandevelopingMongoDBin2007asa
componentofaplannedplatformasaserviceproduct.
 In2009,thecompanyshiftedtoanopensourcedevelopmentmodel,withthe
companyofferingcommercialsupportandotherservices.
 In2013,10gensoftwarechangeditsnameintoMongoDB.
 OnOctober20,2017,MongoDBbecameapublicly-tradedcompany.
WHATISMONGODB?
 MongoDBis
 Crossplatform.
 Opensource.
 Nonrelational.
 Distributed.
 NoSQL.
 Documentorienteddatasource.
 NoSQLtools=itdoesnothaverowsandcolumnsforstoringdatalike
RDBMS.
 Architecture=builtoncollectionsofdocuments.
 Basicunitofdata=setofkey-valuepairs.
WHYMONGODB?
SQL:
 ThemajorchallengesinwithtraditionalRDBMSaredealingwith
largevolumesofdata
richvarietyofdata-particularlyunstructureddata,andmeetinguptothe
scaleneedsofenterprisedata.
 TheneedofDB:
 scalerequirement.
 flexibilitywithrespecttoSchema.
 faulttolerant-consistentandPartitiontolerant.
MongoDB:
 ThedatamodelthatMongoDBfollowsisahighlyelastic.
 MongoDBletsyoucombineandstoredataofmultivariatetypes.
 Thereisnodowntimewhenuserwantstodynamicallymodifytheschemas.
USINGJAVASCRIPTOBJECTNOTATION(JSON)
 JSONisextremelyexpressive.
 StoreandRetrieveiseaseprocess.
 ThisdatabaseusesadocumentstorageformatcalledBSON(BeeSon)which
isabinarystyleofJSONstyledocuments.
 BSONisanopenstandard.Insomecasesitconsumeslessspaceas
comparedtothetext-basedJSON.
 Itsanprogramminglanguage’snativedataformat.
 TheprogramminglanguageavailableinMongoDBare,
 C++
 Java
 python
 PHP
 Ruby
 C#..etc,.usingthebasicbinaryformat enablesthenativedatastructurestobe
builtquicklyforeachlanguagewithoutgoingthrough theinconvenienceof
processingJSON.
CREATINGORGENERATINGAUNIQUEKEY
 EachJSONdocumentsshouldhaveauniqueidentifier.
 _idkey=similartotheprimarykeyrelationaldatabase.
 Uses=ForSearchingthedocument(uniqueidentifier).
 Anindexisautomaticallybuiltontheuniqueidentifier.
0 1 2 3 4 5 6 7 8 9 11 12
Timestamp MachineID ProcessID Counter
 Database-Itiscollectionofcollections.
-Itislikean containerofcollections.itbegincreatedatthefirstattempt
whencollectionmakesreferencetoit.
-Createdondemand.
-EachDBhasitsownsetsoffilesandfilesystem.
-singleMongoDBserver=houseofseveraldatabases.
 Collection-ItislikeaanalogoustoatableofRDBMS.
-Itiscreatedatthefirsttimethatyouattempttosaveadocument.
-Singledatabase.AcollectionholdsaseveralMongoDBdocuments.
-Itdoesnotenforceschema.
-Itcontainsdocumentswithinacollectioncanhavedifferentfields.
 Document-Adocumentisanalogoustoarow/record/TupleinanRDBMS
table.
-Adocumenthasadynamicschema.
-Documentshaveasamefields,the orderofthefieldscanbe
different.
-Documentinacollectionneednotnecessarilyhavethesamesetof
fields/keyvaluepairs.
SUPPORTFORDYNAMICQUERIES
 MongoDBhasextensivesupportforqueries.
 ThisisinkeepingwithtraditionalRDBMSwhereinwehavestaticdataand
dynamicqueries.
 CouchDB-Documentoriented.
-SchemalessNOSQLdatabaseandMongoDB’sbiggestcompetitor.
-worksonquitethereversemanner.
-itsupportthedynamicdataandstaticqueries.
STORINGBINARYDATA
 MongoDBprovidesgridFStosupportthestorageofbinarydata.
 StorageSpace=4MBofdata.
e.g.,photographs(suchaas profilepicture)orsmallaudioclips.
 Ifyouwanttostoremovieclips,MongoDBhasanothersolution.
 Itstoresmetadatainacollectioncalled“file”.
 Chunks-Itsbreaksthatdataintosmallpiecescalled“chunks”.
-Storedin“chunks”collection.
-Takecare=“easyscalability”.
WHYREPLICATION?
 Itprovides
-dataredundancy
-highavailability
 Ithelptorecoverhardwarefailureandservicesinterruptions.
 InMongoDB,
replicaset=singleprimaryandseveralsecondaries.
 Eachwriterequestclientisdirectedtotheprimary.
Primarylogs Oplog(operationallog)
Writerequestinto
 Oplogisthenusedbythesecondaryreplicamemberstosynchronizetheir
data.
 Itsdecidesthe“consistency”.
 Theclientsusuallyreadfromtheprimary.
 Theclientcanalsospecifythereadpreferencethatwilldirecttheread
operationstothesecondary.
REPLICATIONDIAGRAM
writes reads
Replication Replication
TheprocessofREPLICATIONinMongoDB.
Clientapplication
Primary
Secondary Secondary Secondary
SHARDING
LARGEDB SMALLsubdividedDB.
 Itreferstohorizontalscaling.
 Itmeansalargedatabaseordatasetaresubdividedanddistributedintosmall
piecesovermultipleserversorshards.
 Eachshardisanindependentdatabaseandcollectivelytheywouldconstitute
alogicaldatabase.
Theprimeadvantageofshardingis,
 Shardingreducestheamountofdatathateachshardneedtomanageand
store.
 ShardingreducestheNo.Of.operationsthateachshardhandles.
 E.g.,1TB(sizeofdataset)=distributedordividedinto4shards(datasets).
 Eachshardofsize256GBdata.Asfortheclustergrows,theamountofdata
thateachshardwillstoreandmanagewilldecrease.
Shard3
(256GB)
Shard4
(256GB)
Collection
1TBdatabase
Shard1
(256GB)
Shard2
(256GB)
UPDATINGINFORMATIONINPLACE
 MongoDBupdatestheinformationinplace.
 Thisimpliesthatisupdatethedatawhereveritisavailable.
 Itdoesnotallocateseparatespaceandtheindexesremainunaltered.
 MongoDBisallforlazywrites.itwritestothediskonceeverysecond.
 Readingandwritingtodiskisaslowprocessascomparedtoreadingand
fromwritingfrommemory.
TERMSUSEDINRDBMSANDMONGODB
RDBMS
 Database
 Table
 Record
 Columns
 Index
 Joins
 Primarykey
MongoDB
 Database
 Collection
 Document
 Fields/keyvaluepairs
 Index
 Embeddeddocuments
 Primarykey(_idisaidentifier)
MYSQL Oracle MongoDB
Databaseserver MYSqld Oracle Mongod
Databaseclient MYSql SQLPlus mongo
CREATEDATABASE
 Thesyntaxforcreatingadatabaseisasfollows:
useDATABASE_Name
 Tocreateadatabasebythename“myDB”thesyntaxis
usemyDB
e.g.,
>usemyDB;
switchedtodbmyDB
>
 Toconfirmtheexistenceofyourdatabase,typecommandattheMongoDBshell:
db
>db
myDB
>
DROPDATABASE
 Thesyntaxtodeleteordropdatabaseisasfollows:
db.dropDatabase();
e.g.,
usemyDB;
db.dropDatabase();
DATATYPESINMONGODB
 String -MustbeUTF-8valid.
-Mostcommonlyuseddatatypes.
 Integer -Canbe32bitor64bit(depends ontheserver).
 Boolean -Tostoretrue/false
 Double -Tostorefloatingpoint(realvalues).
 Min/Max -TocompareavalueagainstthelowerorhighestBSONelements.
 Arrays -Tostorearrayorlistormultiplevaluesintoonekey.
 Timestamp -Torecordwhenadocumenthasbeenmodifiedoradded.
 Null -Tostoreanullvalue.(null=missingorunknownvalue).
 Date -Tostorethecurrentdateortimeformat.
 ObjectID -Tostorethedocument’sid.
 Binarydata-Tostorebinarydata(images,binaries,etc.,).
 Code -Tostorejavascriptcodeintothedocument.
 Regularexpression-Tostoreregularexpression.

More Related Content

Similar to Mongodb T.ARIFA BEGUM II-M.SC.,COMPUTER SCIENCE BON SECOURS COLLEGE FOR WOMEN

La creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDBLa creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDB
MongoDB
 

Similar to Mongodb T.ARIFA BEGUM II-M.SC.,COMPUTER SCIENCE BON SECOURS COLLEGE FOR WOMEN (20)

MongoDB
MongoDBMongoDB
MongoDB
 
Mongo db
Mongo dbMongo db
Mongo db
 
An introduction to MongoDB by César Trigo #OpenExpoDay 2014
An introduction to MongoDB by César Trigo #OpenExpoDay 2014An introduction to MongoDB by César Trigo #OpenExpoDay 2014
An introduction to MongoDB by César Trigo #OpenExpoDay 2014
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
La creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDBLa creación de una capa operacional con MongoDB
La creación de una capa operacional con MongoDB
 
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
 
An Introduction to SAP BODS: Understanding the Basics and Benefits
An Introduction to SAP BODS: Understanding the Basics and BenefitsAn Introduction to SAP BODS: Understanding the Basics and Benefits
An Introduction to SAP BODS: Understanding the Basics and Benefits
 
MongoDB DOC v1.5
MongoDB DOC v1.5MongoDB DOC v1.5
MongoDB DOC v1.5
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
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
 
Pros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web DevelopmentPros and Cons of MongoDB in Web Development
Pros and Cons of MongoDB in Web Development
 
The Big Picture on Big Data and Cognos
The Big Picture on Big Data and CognosThe Big Picture on Big Data and Cognos
The Big Picture on Big Data and Cognos
 
Road Map for Careers in Big Data
Road Map for Careers in Big DataRoad Map for Careers in Big Data
Road Map for Careers in Big Data
 
Democratization of Data @Indix
Democratization of Data @IndixDemocratization of Data @Indix
Democratization of Data @Indix
 
Mdb dn 2017_17_bi_connector2
Mdb dn 2017_17_bi_connector2Mdb dn 2017_17_bi_connector2
Mdb dn 2017_17_bi_connector2
 
Sree
SreeSree
Sree
 
Building powerful apps with ArangoDB & KeyLines
Building powerful apps with ArangoDB & KeyLinesBuilding powerful apps with ArangoDB & KeyLines
Building powerful apps with ArangoDB & KeyLines
 
Resume
ResumeResume
Resume
 

Recently uploaded

Recently uploaded (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

Mongodb T.ARIFA BEGUM II-M.SC.,COMPUTER SCIENCE BON SECOURS COLLEGE FOR WOMEN