21
Shivam Singhal Software Developer +91 8802.654.130 Under Guidance: Rajat Jain

Atlogys Academy - Tech Talk on Mongo DB

Embed Size (px)

Citation preview

Page 1: Atlogys Academy - Tech Talk on Mongo DB

Shivam SinghalSoftware Developer+91 8802.654.130

Under Guidance:Rajat Jain

Page 2: Atlogys Academy - Tech Talk on Mongo DB

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

Page 3: Atlogys Academy - Tech Talk on Mongo DB

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 4: Atlogys Academy - Tech Talk on Mongo DB

Why NOSQL ??(Not Only SQL or Non-relational databases)

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 5: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 6: Atlogys Academy - Tech Talk on Mongo DB

Types of NOSQL

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 7: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 8: Atlogys Academy - Tech Talk on Mongo DB

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 9: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 10: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 11: Atlogys Academy - Tech Talk on Mongo DB

and many more...

Flexible enough to fit any industry

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 12: Atlogys Academy - Tech Talk on Mongo DB

Platforms Supported by MongoDB

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 13: Atlogys Academy - Tech Talk on Mongo DB

MongoDB Compared to other prevailing DB Tecnologies

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 14: Atlogys Academy - Tech Talk on Mongo DB

MongoDB vs Document DB Tech

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 15: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 16: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 17: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 18: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 19: Atlogys Academy - Tech Talk on Mongo DB

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.”}

Page 20: Atlogys Academy - Tech Talk on Mongo DB

Indexes

Single Field

Compound Fields

Multikey Index

Text Index

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}

Page 21: Atlogys Academy - Tech Talk on Mongo DB

{“author”: “Shivam Singhal”, “organization”: “Atlogys Pvt. Ltd.”}