KEMBAR78
Mongodb | PPTX
Document-oriented Storage

Group : 25
Minoo Rouhi Vejdani
Jitendra Kasaudhan
Foteini Petridi
Argon Lohaj
Habtom Kahsay Gidey
Outline:
•
•
•
•
•

Overview & Key features
Trade-offs & Comparisons
Use Cases & Competitors
Hands-on
Performance Test (My SQL vs Mongo)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

2
Where we are in terms of SDLC:

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

3
What is MongoDB?
MongoDB is a ____ Database.
• No-SQL
• Document-oriented
• Cross-platform

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

4
History
• It is developed by 10gen
• In 2007 as a component of a planned platform as a
service product
• In 2009 as a commercial standalone product

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

5
Key Features
• Document Database: The possibility to store data in JSON like
documents

• Dynamic schema(schemeless): Flexible insertion of data without a
pre-defined schema.

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

6
Key Features(2)
• Auto-Sharding: Automatic and Easy scaling of the database
• Map/Reduce: Providing Flexible aggregation
• Open Source and Free!

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

7
Trade-offs
• High performance and availability.
• Dynamic schema: minimizes cost and time

when application

requirements changes.

• No joins: If you see yourself doing mission critical decisions inside your
application where you will need data from multiple documents
/collections, then you should think twice before using MongoDB.

• No complex transactions:

MongoDB does provide some basic
transactional capabilities. Atomic operations are possible within the scope
of a single document but multi-collection commits with rollback generally
aren’t feasible.

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

8
Trade-offs(2)

Ref: http://fr.slideshare.net/DavidPeyruc/transmart-community-meeting-57-nov-13session-2-mongodb-what-why-and-when
7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

9
Relational vs. Non-Relational
Relational

Non Relational

Scaling

Less scalable.
Vertical scaling i.e a single server must
be made increasingly powerful in order
to deal with increased demand. It is
possible to spread SQL databases over
many servers, but significant additional
engineering is generally required.

Highly scalable.
Horizontal scaling i.e to
add capacity, a database
administrator can simply
add more commodity
servers or cloud instances.
The database automatically
spreads data across servers
as necessary.

Data
Manipulation

Specific language using select, insert, Flexible data manipulation
update etc
using object oriented API.

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

10
Relational vs. Non-Relational
Relational

Non Relational

Consistency

Provides better consistency.

Compromised consistency
in case of multi-object
transactions

Schemas

Structure and data types are fixed in
advance. To store information about a
new data item, the entire database
must be altered, during which time the
database must be taken offline.

Dynamic schema. Records
can add new information
on the fly, and unlike SQL
table rows, dissimilar data
can be stored together as
necessary.

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

11
Use Cases
MongoDB is a general purpose database suitable for most applications and use cases.

Big Data:
Organizations
are
serving more data,
more
users,
more
insight with greater
ease.

Content Management
and Delivery:

Leading organizations
are
relying
on
MongoDB to build nextgeneration
content
management
and
achieve superior user
experience.
7/1/2014

Customer Data
Management:
Embracing new ways of
managing and serving
information
about
users,
including
metadata, preferences,
user state and others

Data Hub:
MongoDB is often used
as the central data hub
for all of company data
because of its ease of
use, and scalability.

Minoo, Jitendra, Foteini, Agon, Habtom

12
Use Cases
MongoDB was selected for the enterprise content management (ECM)
section of the SAP’s platform-as-a-service (PaaS).

Storing Media Metadata on MongoDB: Includes pictures of every item for
sale on eBay.

McAfee Global Threat Intelligence (GTI) is a cloud-based intelligence service
that correlates data from millions of sources. MongoDB enables big data
analytics and supports the real-time flow of cyberthreat (viruses etc) data
between GTI and client products. It currently stores 4 billion documents –
terabytes of data.
“MetLife Wall” :An application allowing MetLife to see a 360-degree view of
all of the customer preferences and interactions, including policy details and
transactions across lines of business.
http://www.mongodb.com/presentations/
7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

13
Use Case: Telefónica
Goal : “Rich services to market faster than ever before.”

They built a Personalisation Server using Oracle 11g to
store customers profile data
Drawbacks of Oracle-based solution:

•

Low performance issues

•

Oversized storage requirements

•

Data outdated

“Customers Data were neither shared nor usable”
7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

14
Use case: Telefónica(2)
MongoDB Solution:
They built an new version of the Personalisation Server with MongoDB 2.0 in 3
months using only 3-4 developers. Some existing features were enhanced and new
ones were added.
Results:
•

Simple, extensible and maintainable schema

•

Performance boost

•

Lower storage requirements
(one third)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

15
Use case: Telefónica(3)
Benefits :

•

Cost
Reduction

•

Low time to market and
more extensibility

•

New opportunities for other
products in market

Source : http://www.mongodb.com/presentations/business-trackhow-mongodb-helps-telefonica-digital-accelerate-time-market

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

16
Major Competitors

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

17
No-SQL database comparison

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

18
Hands On
Contents:
1. Database Structure (Schema Design)
1.1. Concept Overview – Referenced vs. Embedded
2. CRUD Operations
3. MongoDB Web UI

4. MongoDB Trainings
5. Data View

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

19
Performance Test
(My SQL vs Mongo)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

20
Thank You!
Q&A

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

21
Backup Slides

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

22
Installation Process(Windows)
1.

Download the latest production release of MongoDB :

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

23
Installation Process(Windows)
2.

Extract the downloaded archive to C:

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

24
Installation Process(Windows)
3.

4.

7/1/2014

MongoDB requires a data folder to store its files. The default location
for the MongoDB data directory is C:datadb.
To start MongoDB, execute from the Command Prompt:
C:mongodbbinmongod.exe

Minoo, Jitendra, Foteini, Agon, Habtom

25
Installation Process(Windows)
5. Connect to MongoDB using the mongo.exe shell. Open another Command Prompt and
issue the command: C:mongodbbinmongod.exe
Backup Slides
Hands On (1)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

27
Backup Slides
Hands On (2)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

28
Backup Slides
Hands On (3)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

29
Backup Slides
Hands On (4)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

30
Backup Slides
Hands On (5)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

31
Backup Slides
Hands On (6)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

32
Backup Slides
Hands On (7)

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

33
Reference
• http://www.mongodb.org/
• http://en.wikipedia.org/wiki/MongoDB
• http://docs.mongodb.org/manual/tutorial/isolate-sequence-ofoperations/
• http://docs.mongodb.org/manual/faq/fundamentals/#does-mongodbsupport-transactions
• http://www.mongodb.com/document-databases
• http://www.mongodb.com/presentations/

7/1/2014

Minoo, Jitendra, Foteini, Agon, Habtom

34

Mongodb

  • 1.
    Document-oriented Storage Group :25 Minoo Rouhi Vejdani Jitendra Kasaudhan Foteini Petridi Argon Lohaj Habtom Kahsay Gidey
  • 2.
    Outline: • • • • • Overview & Keyfeatures Trade-offs & Comparisons Use Cases & Competitors Hands-on Performance Test (My SQL vs Mongo) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 2
  • 3.
    Where we arein terms of SDLC: 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 3
  • 4.
    What is MongoDB? MongoDBis a ____ Database. • No-SQL • Document-oriented • Cross-platform 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 4
  • 5.
    History • It isdeveloped by 10gen • In 2007 as a component of a planned platform as a service product • In 2009 as a commercial standalone product 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 5
  • 6.
    Key Features • DocumentDatabase: The possibility to store data in JSON like documents • Dynamic schema(schemeless): Flexible insertion of data without a pre-defined schema. 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 6
  • 7.
    Key Features(2) • Auto-Sharding:Automatic and Easy scaling of the database • Map/Reduce: Providing Flexible aggregation • Open Source and Free! 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 7
  • 8.
    Trade-offs • High performanceand availability. • Dynamic schema: minimizes cost and time when application requirements changes. • No joins: If you see yourself doing mission critical decisions inside your application where you will need data from multiple documents /collections, then you should think twice before using MongoDB. • No complex transactions: MongoDB does provide some basic transactional capabilities. Atomic operations are possible within the scope of a single document but multi-collection commits with rollback generally aren’t feasible. 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 8
  • 9.
  • 10.
    Relational vs. Non-Relational Relational NonRelational Scaling Less scalable. Vertical scaling i.e a single server must be made increasingly powerful in order to deal with increased demand. It is possible to spread SQL databases over many servers, but significant additional engineering is generally required. Highly scalable. Horizontal scaling i.e to add capacity, a database administrator can simply add more commodity servers or cloud instances. The database automatically spreads data across servers as necessary. Data Manipulation Specific language using select, insert, Flexible data manipulation update etc using object oriented API. 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 10
  • 11.
    Relational vs. Non-Relational Relational NonRelational Consistency Provides better consistency. Compromised consistency in case of multi-object transactions Schemas Structure and data types are fixed in advance. To store information about a new data item, the entire database must be altered, during which time the database must be taken offline. Dynamic schema. Records can add new information on the fly, and unlike SQL table rows, dissimilar data can be stored together as necessary. 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 11
  • 12.
    Use Cases MongoDB isa general purpose database suitable for most applications and use cases. Big Data: Organizations are serving more data, more users, more insight with greater ease. Content Management and Delivery: Leading organizations are relying on MongoDB to build nextgeneration content management and achieve superior user experience. 7/1/2014 Customer Data Management: Embracing new ways of managing and serving information about users, including metadata, preferences, user state and others Data Hub: MongoDB is often used as the central data hub for all of company data because of its ease of use, and scalability. Minoo, Jitendra, Foteini, Agon, Habtom 12
  • 13.
    Use Cases MongoDB wasselected for the enterprise content management (ECM) section of the SAP’s platform-as-a-service (PaaS). Storing Media Metadata on MongoDB: Includes pictures of every item for sale on eBay. McAfee Global Threat Intelligence (GTI) is a cloud-based intelligence service that correlates data from millions of sources. MongoDB enables big data analytics and supports the real-time flow of cyberthreat (viruses etc) data between GTI and client products. It currently stores 4 billion documents – terabytes of data. “MetLife Wall” :An application allowing MetLife to see a 360-degree view of all of the customer preferences and interactions, including policy details and transactions across lines of business. http://www.mongodb.com/presentations/ 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 13
  • 14.
    Use Case: Telefónica Goal: “Rich services to market faster than ever before.” They built a Personalisation Server using Oracle 11g to store customers profile data Drawbacks of Oracle-based solution: • Low performance issues • Oversized storage requirements • Data outdated “Customers Data were neither shared nor usable” 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 14
  • 15.
    Use case: Telefónica(2) MongoDBSolution: They built an new version of the Personalisation Server with MongoDB 2.0 in 3 months using only 3-4 developers. Some existing features were enhanced and new ones were added. Results: • Simple, extensible and maintainable schema • Performance boost • Lower storage requirements (one third) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 15
  • 16.
    Use case: Telefónica(3) Benefits: • Cost Reduction • Low time to market and more extensibility • New opportunities for other products in market Source : http://www.mongodb.com/presentations/business-trackhow-mongodb-helps-telefonica-digital-accelerate-time-market 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 16
  • 17.
  • 18.
    No-SQL database comparison 7/1/2014 Minoo,Jitendra, Foteini, Agon, Habtom 18
  • 19.
    Hands On Contents: 1. DatabaseStructure (Schema Design) 1.1. Concept Overview – Referenced vs. Embedded 2. CRUD Operations 3. MongoDB Web UI 4. MongoDB Trainings 5. Data View 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 19
  • 20.
    Performance Test (My SQLvs Mongo) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 20
  • 21.
  • 22.
  • 23.
    Installation Process(Windows) 1. Download thelatest production release of MongoDB : 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 23
  • 24.
    Installation Process(Windows) 2. Extract thedownloaded archive to C: 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 24
  • 25.
    Installation Process(Windows) 3. 4. 7/1/2014 MongoDB requiresa data folder to store its files. The default location for the MongoDB data directory is C:datadb. To start MongoDB, execute from the Command Prompt: C:mongodbbinmongod.exe Minoo, Jitendra, Foteini, Agon, Habtom 25
  • 26.
    Installation Process(Windows) 5. Connectto MongoDB using the mongo.exe shell. Open another Command Prompt and issue the command: C:mongodbbinmongod.exe
  • 27.
    Backup Slides Hands On(1) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 27
  • 28.
    Backup Slides Hands On(2) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 28
  • 29.
    Backup Slides Hands On(3) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 29
  • 30.
    Backup Slides Hands On(4) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 30
  • 31.
    Backup Slides Hands On(5) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 31
  • 32.
    Backup Slides Hands On(6) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 32
  • 33.
    Backup Slides Hands On(7) 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 33
  • 34.
    Reference • http://www.mongodb.org/ • http://en.wikipedia.org/wiki/MongoDB •http://docs.mongodb.org/manual/tutorial/isolate-sequence-ofoperations/ • http://docs.mongodb.org/manual/faq/fundamentals/#does-mongodbsupport-transactions • http://www.mongodb.com/document-databases • http://www.mongodb.com/presentations/ 7/1/2014 Minoo, Jitendra, Foteini, Agon, Habtom 34