3 scenarios when to use mongodb!

31
www.edureka.co/r-for-analytics www.edureka.co/mongodb 3 Scenarios When to use MongoDB!

Upload: edureka

Post on 24-Jan-2018

1.410 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: 3 scenarios when to use MongoDB!

www.edureka.co/r-for-analytics

www.edureka.co/mongodb

3 Scenarios When to use MongoDB!

Page 2: 3 scenarios when to use MongoDB!

Slide 2Slide 2Slide 2 www.edureka.co/mongodb

Today we will take you through the following:

NoSQL vs SQL

CAP Theorem

MongoDB Unleashed

MongoDB Market Demand

Companies using MongoDB

3 Scenarios where MongoDB suits best

Agenda

(Hands ON)

Page 3: 3 scenarios when to use MongoDB!

Slide 3Slide 3Slide 3 www.edureka.co/mongodb

NoSQL vs SQL

Page 4: 3 scenarios when to use MongoDB!

Slide 4Slide 4Slide 4 www.edureka.co/mongodb

Table basedDocument basedKey-value pairs etc..

Predefined schemaDynamic schema

Vertically scalableHorizontally scalable

Good fit for the complex queryNot good fit for complex queries

Emphasizes on ACID properties( Atomicity, consistency, isolation and durability)

Follows the CAP theorem ( consistency, availability and partition tolerance )

NoSQL SQL

NoSQL vs SQL

Page 5: 3 scenarios when to use MongoDB!

Slide 5Slide 5Slide 5 www.edureka.co/mongodb

CAP Theorem

Page 6: 3 scenarios when to use MongoDB!

Slide 6Slide 6Slide 6 www.edureka.co/mongodb

It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees :

Consistency (all nodes see the same data at the same time)

Availability (a guarantee that every request receives a response about whether it succeeded or failed)

Partition tolerance (the system continues to operate despite arbitrary partitioning due to network failures)

CAP Theorem

Page 7: 3 scenarios when to use MongoDB!

Slide 7Slide 7Slide 7 www.edureka.co/mongodb

MongoDB and its Top Features

Page 8: 3 scenarios when to use MongoDB!

Slide 8Slide 8Slide 8 www.edureka.co/mongodb

MongoDB

free and open-source software

cross-platform document-oriented database

JSON-like documents with

dynamic schemas

What is MongoDB

Page 9: 3 scenarios when to use MongoDB!

Slide 9Slide 9Slide 9 www.edureka.co/mongodb

Document-Oriented

• Store the business subject in the minimal number of documents e.g. instead of storing title and author information in two distinct relational structures, title, author, and other title-related information can all be stored in a single document called Book

Ad hoc Queries• MongoDB supports search by field, range queries, regular expression searches

• Queries can return specific fields of documents and also include user-defined JavaScript functions

Indexing• Any field in a MongoDB document can be indexed

• Secondary indices are also available

MongoDB Features

Page 10: 3 scenarios when to use MongoDB!

Slide 10Slide 10Slide 10 www.edureka.co/mongodb

Document-Oriented

• Store the business subject in the minimal number of documents e.g. instead of storing title and author information in two distinct relational structures, title, author, and other title-related information can all be stored in a single document called Book

Ad hoc Queries• MongoDB supports search by field, range queries, regular expression searches

• Queries can return specific fields of documents and also include user-defined JavaScript functions

Indexing• Any field in a MongoDB document can be indexed

• Secondary indices are also available

MongoDB Features

Page 11: 3 scenarios when to use MongoDB!

Slide 11Slide 11Slide 11 www.edureka.co/mongodb

Document-Oriented

• Store the business subject in the minimal number of documents e.g. instead of storing title and author information in two distinct relational structures, title, author, and other title-related information can all be stored in a single document called Book

Ad hoc Queries• MongoDB supports search by field, range queries, regular expression searches

• Queries can return specific fields of documents and also include user-defined JavaScript functions

Indexing• Any field in a MongoDB document can be indexed

• Secondary indices are also available

MongoDB Features

Page 12: 3 scenarios when to use MongoDB!

Slide 12Slide 12Slide 12 www.edureka.co/mongodb

Replication

• MongoDB provides high availability with replica sets i.e.

• A replica set consists of two or more copies of the data

• Each replica set member may act in the role of primary or secondary replica at any time

• When a primary replica fails, the secondary should become the primary

Load Balancing

• MongoDB scales horizontally using sharding i.e.

• The user chooses a shard key, which determines how the data in a collection will be distributed

• The data is split into ranges (based on the shard key) and distributed across multiple shards

File storage

• MongoDB can be used as a file system, taking advantage of multiple machines for storing files

• Exposes functions for file manipulation and content to developers

• Load-balanced and fault-tolerant system

MongoDB Features

Page 13: 3 scenarios when to use MongoDB!

Slide 13Slide 13Slide 13 www.edureka.co/mongodb

Replication

• MongoDB provides high availability with replica sets i.e.

• A replica set consists of two or more copies of the data

• Each replica set member may act in the role of primary or secondary replica at any time

• When a primary replica fails, the secondary should become the primary

Load Balancing

• MongoDB scales horizontally using sharding i.e.

• The user chooses a shard key, which determines how the data in a collection will be distributed

• The data is split into ranges (based on the shard key) and distributed across multiple shards

File storage

• MongoDB can be used as a file system, taking advantage of multiple machines for storing files

• Exposes functions for file manipulation and content to developers

• Load-balanced and fault-tolerant system

MongoDB Features

Page 14: 3 scenarios when to use MongoDB!

Slide 14Slide 14Slide 14 www.edureka.co/mongodb

Replication

• MongoDB provides high availability with replica sets i.e.

• A replica set consists of two or more copies of the data

• Each replica set member may act in the role of primary or secondary replica at any time

• When a primary replica fails, the secondary should become the primary

Load Balancing

• MongoDB scales horizontally using sharding i.e.

• The user chooses a shard key, which determines how the data in a collection will be distributed

• The data is split into ranges (based on the shard key) and distributed across multiple shards

File storage

• MongoDB can be used as a file system, taking advantage of multiple machines for storing files

• Exposes functions for file manipulation and content to developers

• Load-balanced and fault-tolerant system

MongoDB Features

Page 15: 3 scenarios when to use MongoDB!

Slide 15Slide 15Slide 15 www.edureka.co/mongodb

Aggregation

• MapReduce can be used for batch processing of data and aggregation operations

• The aggregation framework enables users to obtain the kind of results for which the SQL GROUP BY clause is used

Server-side JavaScript execution

• JavaScript can be used in queries, aggregation functions (such as MapReduce) and sent directly to the database to be executed

Capped Collections• Supports fixed-size collections called capped collections

• This type of collection maintains insertion order and once the specified size has been reached, behaves like a circular queue

MongoDB Features

Page 16: 3 scenarios when to use MongoDB!

Slide 16Slide 16Slide 16 www.edureka.co/mongodb

Aggregation

• MapReduce can be used for batch processing of data and aggregation operations

• The aggregation framework enables users to obtain the kind of results for which the SQL GROUP BY clause is used

Server-side JavaScript execution

• JavaScript can be used in queries, aggregation functions (such as MapReduce) and sent directly to the database to be executed

Capped Collections• Supports fixed-size collections called capped collections

• This type of collection maintains insertion order and once the specified size has been reached, behaves like a circular queue

MongoDB Features

Page 17: 3 scenarios when to use MongoDB!

Slide 17Slide 17Slide 17 www.edureka.co/mongodb

Aggregation

• MapReduce can be used for batch processing of data and aggregation operations

• The aggregation framework enables users to obtain the kind of results for which the SQL GROUP BY clause is used

Server-side JavaScript execution

• JavaScript can be used in queries, aggregation functions (such as MapReduce) and sent directly to the database to be executed

Capped Collections• Supports fixed-size collections called capped collections

• This type of collection maintains insertion order and once the specified size has been reached, behaves like a circular queue

MongoDB Features

Page 18: 3 scenarios when to use MongoDB!

Slide 18Slide 18Slide 18 www.edureka.co/mongodb

MongoDB RDBMS

Source : Google Trends

Interest over time

MongoDB is searched more over traditional RDBMS :

MongoDB Search Trend

Page 19: 3 scenarios when to use MongoDB!

Slide 19Slide 19Slide 19 www.edureka.co/mongodb

As per indeed.com and linkedin there are most job posting for MongoDb and the skill index is continuously growing :

MongoDB Job And Market Trend

Source : linkedin

Page 20: 3 scenarios when to use MongoDB!

Slide 20Slide 20Slide 20 www.edureka.co/mongodb

Companies using MongoDB

Page 21: 3 scenarios when to use MongoDB!

Slide 21Slide 21Slide 21 www.edureka.co/mongodb

The Weather Channel turned to MongoDB to get killer features out to users quickly

MongoDB Application

Page 22: 3 scenarios when to use MongoDB!

Slide 22Slide 22Slide 22 www.edureka.co/mongodb

Otto Reinvents E-commerce Personalization for More than 2 Million Visitors Per Day with MongoDB

MongoDB Application

Page 23: 3 scenarios when to use MongoDB!

Slide 23Slide 23Slide 23 www.edureka.co/mongodb

Rethinking The Customer Experience at Metlife: From Stalled to Success in Three Months with MongoDB

MongoDB Application

Page 24: 3 scenarios when to use MongoDB!

Slide 24Slide 24Slide 24 www.edureka.co/mongodb

ADP: Meeting Mobile Demands, One Innovative App at a Time

MongoDB Application

Page 25: 3 scenarios when to use MongoDB!

Slide 25Slide 25Slide 25 www.edureka.co/mongodb

3 Scenarios How Expedia uses MongoDB

Page 26: 3 scenarios when to use MongoDB!

Slide 26Slide 26Slide 26 www.edureka.co/mongodb

Scenario 1

When you need your results in real time inspite of changing schema

MongoDB’s flexible document store and simple horizontal scale-out make it possible for Expedia to

create a feature that gives every user a relevant, seamless shopping experience.

That collects highly-dynamic customer information in real-time and presents personalized offers on the fly.

Page 27: 3 scenarios when to use MongoDB!

Slide 27Slide 27Slide 27 www.edureka.co/mongodb

Scenario 2

When you need flexible data model

MongoDB’s flexible data model makes it easy to store any combination of city pairs, dates and destinations.

Expedia can even continue shopping for someone after that customer has closed out a session. When thecustomer returns, all the latest pricing and availability for their searches are displayed side by side on theirScratchpad.

Page 28: 3 scenarios when to use MongoDB!

Slide 28Slide 28Slide 28 www.edureka.co/mongodb

Scenario 3

When you need indexing

MongoDB's rich indexes are used to power analytics that make personalized suggestions to users while theyshop. Expedia can also analyze patterns to pinpoint trends that offer a better understanding of what customersare looking for.

For a consumer, personalization saves time, saves money, and gets them one step closer to what they’re reallyafter i.e. a cool vacation.

For Expedia, real-time personalization powered by MongoDB means customer loyalty, increased conversionsand a competitive edge that goes straight to the bottom line.

Page 29: 3 scenarios when to use MongoDB!

Questions

Slide 29

Page 30: 3 scenarios when to use MongoDB!

Slide 30

Your feedback is vital for us, be it a compliment, a suggestion or a complaint. It helps us to make your experience better!

Please spare few minutes to take the survey after the webinar.

Survey

Page 31: 3 scenarios when to use MongoDB!