Download presentation
Presentation is loading. Please wait.
1
Dineesha Suraweera
2
What is mongoDB? Open Source Document Oriented database
Cross- Platform No - SQL 1
3
Published as GNU Affero General Public License and the Apache License
Developed by 10gen in 2007 Published as GNU Affero General Public License and the Apache License
4
Document Oriented vs Relational Databases
Schema less Structure of a single object is clear No complex joins Deep query-ability Ease of scale-out Conversion / mapping of application objects to database objects not needed Uses internal memory for storing the working set, enabling faster access of data
5
RDBMS mongoDB Database Table Collection Tuple/Row Document column Field Table Join Embedded Documents Primary Key Primary Key (Default key _id provided by mongodb itself)
6
MongoDB Architecture
7
Features Ad hoc queries Indexing Replication File storage Aggregation
Sharding Capped collections
8
Horizontally Scalable Architecture
9
Sharding
10
Replication
11
Document Storage Document are stored in BSON(Binary JSON)
BSON - binary serialization of json like objects. Any valid JSON can easily imported and queried. MongoDB understand JSON natively.
12
MongoDB Storage Engines
13
db – show currently selected database. show dbs – output database list
Create Database use DATABASE_NAME db – show currently selected database. show dbs – output database list
14
db.createCollection(name, options)
"mycol", { capped : true, autoIndexID : true, Size : , max : 10000 } )
15
db.COLLECTION_NAME.insert(document)
db.mycol.insert({ _id: ObjectId(7df78ad8902c), title: 'MongoDB Overview', description: 'MongoDB is no sql database', tags: ['mongodb', 'database', 'NoSQL'], likes: 100 })
16
Sample Document { _id: ObjectId(7df78ad8902c)
title: 'MongoDB Overview', description: 'MongoDB is no sql database', tags: ['mongodb', 'database', 'NoSQL'], likes: 100, comments: [ user:'user1', message: 'My first comment', dateCreated: new Date(2016,1,20,2,15), like: 0 }, user:'user2', message: 'My second comments', dateCreated: new Date(2016,1,25,7,45), like: 5 } ]
17
db.COLLECTION_NAME.find()
Query Document db.COLLECTION_NAME.find() (formatted way) db.COLLECTION_NAME.find().pretty()
18
db.COLLECTION_NAME.ensureIndex({KEY:1})
Indexing db.COLLECTION_NAME.ensureIndex({KEY:1}) db.mycol.ensureIndex({"title":1,"description":-1})
19
Demonstration
20
Non-Functional Features
Easy readability High performance High availability Easy scalability Aggregation Stores data as documents or objects (everyone works with objects)
21
Disadvantages or less good at ????
High transactions Problems that require SQL
22
Other No-SQL databases
Cassandra Accumulo Cloudata HPCC ConcourseDB Druid SpliceMachine
23
Big Data Where to use ??? Content Management and Delivery
Mobile and Social Infrastructure User Data Management Data Hub
24
Adobe Ebay LinkedIn McAfee SAP Yandex
Users of MongoDB Adobe Ebay LinkedIn McAfee SAP Yandex
25
Thank You!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.