Upload
atlogys-technical-consulting
View
103
Download
0
Embed Size (px)
Citation preview
Shivam SinghalSoftware Developer+91 8802.654.130
Under Guidance:Rajat Jain
Platforms supported by MongoDB
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Topics to discussWhy NOSQL??
Types of NOSQL
MongoDB
Introduction
Features of MongoDB
Who is using MongoDB
MongoDB Compared to other prevailing DB Technologies
MongoDB vs Document DB Tech
Mapping Chart
CRUD & Indexes
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Why NOSQL ??(Not Only SQL or Non-relational databases)
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
NOSQL attempts to address dynamic : Developers are working with applications that create massive volumes of new, rapidly changing data types — structured, semi-structured, unstructured and polymorphic data.
Flexible(Agile Model): Long gone is the twelve-to-eighteen month waterfall model. Now small teams work in agile sprints, iterating quickly & pushing code every week or two, some even multiple times a day.
Scalability: Applications that once served a finite audience are now delivered as services that must be always-on, accessible from many different devices and scaled globally to millions of users.
Availability: Organizations are now turning to scale-out architectures using open source software, commodity servers and cloud computing instead of large monolithic servers and storage infrastructure.
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Types of NOSQL
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Key Value DB
Amazon Dynamo, Riak, Oracle NOSQL DB
Column family
Big Table, Hbase, Apache Cassandra
Document DB
BaseX, MongoDB, CouchDB, Solr
Graph DB
Neo4j, Dgraph, GraphBase
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
MongoDB derieved from humongous
Document Oriented Database
Open Source, cross platform
JSON-like(BSON) Dynamic schemas
Powerfull query Language
SDKs for multiple platforms
- C, C#, C++, PHP, Java, Javascript, NodeJS, Perl, Ruby, Scala
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Features of MongoDB
Rich Query Language
Indexing
Storage Engines, File storage
Replication, Load balancing
Capped Collection
Server Side Javascript execution
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
and many more...
Flexible enough to fit any industry
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Platforms Supported by MongoDB
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
MongoDB Compared to other prevailing DB Tecnologies
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
MongoDB vs Document DB Tech
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Mapping Chart
Detailed: https://docs.mongodb.com/manual/reference/sql-aggregation-comparison/
SQL MongoDB
database database
table collection
row document or BSON document
column field
index index
table joins embedded documents and linking
primary key, specify any unique column or column combination as primary key.
primary key, is automatically set to the _id field.
aggregation (e.g. group by) aggregation pipeline
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
CRUDdb.collection.insert()
db.collection.insertOne()
db.collection.insertMany() New in version 3.2
db.collection.bulkWrite() Old version 2.x
DEMO...
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
CRUDdb.collection.find()
db.collection.findOne()
db.collection.count()
DEMO...
db.collection.aggregate()
db.runCommand({ distinct:
"<collection>", key: "<field>", query: <query> })
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
CRUDdb.collection.update()
db.collection.updateOne() New in version 3.2
db.collection.updateMany() New in version 3.2
DEMO...
db.collection.replaceOne() New in version 3.2
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
CRUDdb.collection.remove()
db.collection.deleteOne() New in version 3.2
db.collection.deleteMany() New in version 3.2
DEMO...
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
Indexes
Single Field
Compound Fields
Multikey Index
Text Index
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}
{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}