2. Mongo DB is a document
oriented database. It is an
open source product,
developed and supported by
a company named 10gen.
MongoDB is written in C++.
The manufacturing company
10 gen has given the
definition of Mongo DB:
"Mongo DB is scalable, open
source, high performance,
document oriented database." -
10 gen
MongoDB was designed to
work with commodity
servers. Now it is used by
company of all sizes, across
all industry.
3. What is mongoDB ?
Data model: using BSON (binary JSON), developers can easily
map to modern object-oriented languages without a
complicated ORM layer.
ORM: Object Relational Mapping
BSON: Binary JSON based on JSON.
Lightweight, Traversable, Efficient.
MongoDB is a cross-platform, document oriented database that
provides, high performance, high availability, and easy scalability.
MongoDB works on concept of collection and document.
4. Scalable High-Performance Open-source, Document-Oriented
database.
Built for Speed
Rich Document based queries for Easy readability.
Full Index Support for High Performance.
Replication and Failover for High Availability.
Auto Sharding for Easy Scalability.
Map / Reduce for Aggregation.
5. History of MongoDB
The initial development of MongoDB began in 2007 when the company was building a
platform as a service similar to window azure.
"Window azure is a cloud computing platform and
infrastructure, created by Microsoft, to build,
deploy and manage applications and service through
a global network."MongoDB was developed by a New York based organization named 10gen
which is now known as MongoDB Inc. It was initially developed as a PAAS
(Platform As A Service). Later in 2009, it is introduced in the market as an
open source database server that was maintained and supported by MongoDB
Inc.
The first ready production of MongoDB has been considered from version 1.4
which was released in March 2010.
MongoDB2.4.9 was the latest and stable version which was released on
January 10, 2014.
latest version is 3.6
First of all, we should know what is document oriented database?
6. 10gen is the company behind
MongoDB.
Founded in 2007
• Dwight Merriman, Eliot Horowitz
• Doubleclick, Oracle, Marklogic, HP
Worldwide Expanding
Team
• 140+ employees
• NY, Palo Alto, London, Dublin, Sydney
Set the direction & Contribute
code to
MongoDB
Foster
Community
&
ecosystem
Provide
Commercial
services
Provide MongoDB
Management Services
7. Why MongoDB?
SQL was invented in the 70’s to store data.
MongoDB stores documents (or) objects.
Now-a-days, everyone works with objects
(Python/Ruby/Java/etc.)
And we need Databases to persist our objects.
Then why not store objects directly ?
Embedded documents and arrays reduce need for joins. No Joins
and No-multi document
transactions.
8. This may be a very genuine question that - "what was
the need of mongodb although there were many
databases in action?“
This is a very simple answer:
All the modern applications require big data, fast
features development, flexible deployment and the
older database systems not enough competent, so the
mongodb was obviously needed.
Purpose to build MongoDB
9. Features of MongoDB
These are some important features of mongoDB.
1. Support ad hoc queries
In MongoDB, you can search by field, range query and it also supports regular expression
searches.
2. Indexing
You can index any field in a document.
3. Replication
MongoDB supports Master Slave replication.
A master can perform Reads and Writes and a Slave copies data from the master and can
only be used for reads or back up (not writes)
4. Duplication of data
MongoDB can run over multiple servers. The data is duplicated to keep the system up and
also keep its running condition in case of hardware failure.
10. 5. Load balancing
It has an automatic load balancing configuration because of data placed in shards.
6. Supports map reduce and aggregation tools.
7. Uses JavaScript instead of Procedures.
8. It is a schema-less database written in C++.
9. Provides high performance.
10. Stores files of any size easily without complicating your stack.
11. Easy to administer in the case of failures.
12. It also supports:
• JSON data model with dynamic schemas
• Auto-sharding for horizontal scalability
• Built in replication for high availability
13. Operating System : Cross-Platform
Now a day many companies using MongoDB to create new types of
applications, improve performance and availability.
12. Data as Documents
MongoDB stores data in a binary representation called BSON (Binary
JSON). The BSON encoding extends the popular JSON (JavaScript Object
Notation) representation to include additional types such as int, long, date,
floating point, and decimal128.
MongoDB documents tend to have all data for a given record in a
single document, whereas in a relational database information for a
given record is usually spread across many tables.
“Data as documents: simpler for
developers, faster for users.”
13. How does the MongoDB data model stack up to relational databases and key-value stores? Take
a look at the chart below:
MongoDB scales like crazy. Whether you are sharding to scale data
volume, performance or cross-data center operations, you can do it with
MongoDB.
14. Document Store
RDBMS MongoDB
Database Database
Table, view Collection
Row Documents(JSON, BSON)
Column Field
Index Index
Join Embedded Document
Foreign Key Reference
Partition Key Shard Key
16. MongoDB CURD operation
Four basic operation in mongoDB.
1. Create Operations
2. Update Operations
3. Read Operations
4. Delete Operations
Create Operations:
Create or insert operations add new documents to a collection. If the collection does not
currently exist, insert operations will create the collection.
MongoDB provides the following methods to insert documents into a collection:
db.collection.insertOne(
<document>,
{
name : “ Hyphen ” , Document
status : “ pending ”
}
)
• db.collection.insertMany()
17. Update Operations:
Update operations modify existing documents in a collection. MongoDB provides the
following methods to update documents of a collection:
db.users.updateMany( collection
{ age : { $ lt : 18 } } , update filter
{ $ set : { status : “ reject ” } } update action
)
• db.collection.UpdateOne()
• db.collection.replace()
Read Operations:
Read operations retrieves documents from a collection; i.e. queries a collection for
documents. MongoDB provides the following methods to read documents from a collection:
db.users.find( collection
query criteria
{ age : { $ gt : 18 } } , projection
{ name: 1 , address : 1 } update action
) . Limit(5)
18. Delete Operations:
Delete operations remove documents from a collection. MongoDB provides the
following methods to delete documents of a collection:
db.users.deleteMany( collection
{ status : “ reject ”} delete filter
)
• db.collection.deleteOne()
Pictures with reflection and blurred background
(Basic)
To reproduce the picture effects on this slide, do the following:
On the Home tab, in the Slides group, click Layout, and then click Blank.
On the Insert tab, in the Images group, click Picture.
In the Insert Picture dialog box, select a picture and then click Insert.
Select the picture. Under Picture Tools, on the Format tab, in the Size group, click the arrow below Crop, point to Crop to Shape, and then under Rectangles click Round Diagonal Corner Rectangle.
Also under Picture Tools, on the Format tab, in the Size group, click the Size and Position dialog box launcher. In the Format Picture dialog box, resize or crop the image so that the height is set to 2” and the width is set to 2.4”. To crop the picture, click Crop in the left pane, and in the right pane, under Crop position, enter values into the Height, Width, Left, and Top boxes. To resize the picture, click Size in the left pane, and in the right pane, under Size and rotate, enter values into the Height and Width boxes.
Also in the Format Picture dialog box, click Reflection in the right pane, and in the Reflection pane, in the Presets list, click Half Reflection, Touching.
On the Insert tab, in the Images group, click Picture.
In the Insert Picture dialog box, select a different picture and then click Insert. Repeat this process until there are three pictures on the slide.
Select the second picture. Under Picture Tools, on the Format tab, in the Size group, click the Size and Position dialog box launcher. In the Format Picture dialog box, resize or crop the image so that the height is set to 2” and the width is set to 2.4”. To crop the picture, click Crop in the left pane, and in the right pane, under Crop position, enter values into the Height, Width, Left, and Top boxes. To resize the picture, click Size in the left pane, and in the right pane, under Size and rotate, enter values into the Height and Width boxes.
Select the third picture. Under Picture Tools, on the Format tab, in the Size group, click the Size and Position dialog box launcher. In the Format Picture dialog box, resize or crop the image so that the height is set to 2” and the width is set to 2.4”. To crop the picture, click Crop in the left pane, and in the right pane, under Crop position, enter values into the Height, Width, Left, and Top boxes. To resize the picture, click Size in the left pane, and in the right pane, under Size and rotate, enter values into the Height and Width boxes.
Select the first picture. On the Home tab, in the Clipboard group, click Format Painter. With the Format Painter cursor, on the slide, click the second picture.
Select the first picture. On the Home tab, in the Clipboard group, click Format Painter. With the Format Painter cursor, on the slide, click the third picture.
Press and hold CTRL, and then select all three pictures. On the Home tab, in the Drawing group, click Arrange, point to Align, and then do the following:
Click Align Selected Objects.
Click Align Middle.
To reproduce the background effects on this slide, do the following:
On the Insert tab, in the Images group, click Picture.
In the Insert Picture dialog box, select a picture and then click Insert.
Select the picture. Under Picture Tools, on the Format tab, in the Size group, click the Size and Position dialog box launcher. In the Format Picture dialog box, resize or crop the image so that the height is set to 7.5” and the width is set to 10”. To crop the picture, click Crop in the left pane, and in the right pane, under Crop position, enter values into the Height, Width, Left, and Top boxes. To resize the picture, click Size in the left pane, and in the right pane, under Size and rotate, enter values into the Height and Width boxes.
Also in the Format Picture dialog box, click Artistic Effects in the left pane, and in the Artistic Effects pane, do the following:
Click the button next to Presets and then click Blur (second row, fifth option from the left).
In the Radius box, enter 30.
On the Home tab, in the Drawing group, click Shapes, and under Rectangles click Rectangle (first option from the left).
Drag to draw a rectangle on the slide.
Select the rectangle. Under Drawing Tools, on the Format tab, in the Size group, enter 7.5” into the Height box and enter 10” into the Width box.
Also under Drawing Tools, on the Format tab, in the Shape Styles group, click Shape Fill, point to Gradients, and then click More Gradients. In the Format Shape dialog box, click Fill in the left pane, select Gradient fill in the Fill pane, and then do the following:
In the Type list, select Radial.
In the Direction list, select From Center.
Under Gradient stops, click Add gradient stops or Remove gradient stops until two stops appear in the slider.
Also under Gradient stops, customize the gradient stops as follows:
Select the first stop from the left in the slider, and then do the following:
In the Position box, enter 0%.
Click the button next to Color, and then under Theme Colors click White, Background 1 (first row, first option from the left).
In the Transparency box, enter 60%.
Select the second stop from the left in the slider, and then do the following:
In the Position box, enter 100%.
Click the button next to Color, and then under Theme Colors click White, Background 1 (first row, first option from the left).
In the Transparency box, enter 0%.
Also in the Format Shape dialog box, click Line Color in the right pane, and in the Line Color pane select No Line.
Select the shape. On the Home tab, in the Drawing group, click Arrange, point to Align, and then do the following:
Click Align to slide.
Click Align Middle.
Click Align Center.
On the Home tab, in the Drawing group, click Arrange, and then click Send to Back.
Select the background picture. On the Home tab, in the Drawing group, click Arrange, and then click Send to Back.