Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

MongoDB Intro

No description
by

Chantal Bisson

on 26 March 2013

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of MongoDB Intro

Rich Querying (CRUD) Document-Oriented Storage JSON-Style Documents Features Replication & High Availability Supports asynchronous replication of data between servers for failover and redundancy.
Needs a majority of votes to elect a new primary.
Replica Sets increases read scalability. Auto-Sharding & Scalability Distributes a single logical database system across a cluster of machines.
Offers easy addition of new machines.
Zero single points of failure architecture.
Increases read and write
scalability.
Automatic balancing for
changes in load and data
distribution.
Adds additional complexity
to the system.
Impacts aggregation
performance. Use Cases Simple queries
Easier and faster integration of data
RDBMS replacement for Web Applications.
Semi-structured Content Management.
Real-time analytic and High-Speed Logging.
Caching and High Scalability. Document-Oriented Storage
Rich Querying (CRUD)
Replication & High Availability
Auto-Sharding & Scalability
Full Index Support
Fast In-Place Updates
Map/Reduce
GridFS MongoDB (from "humongous") is an open source document database, and the leading NoSQL database. Written in C++. Example: { _id: '47cc67093475061e3d95369d'
author: 'joe',
created : new Date('03/28/2009'),
title : 'Yet another blog post',
text : 'Here is the text...',
tags : [ 'example', 'joe' ]
} Collections Logical groups of documents
No document structure enforced
Indexes are per-collection Divers C, C++, C#, Erlang, Java, JavaScript, Node.js, Perl, PHP, Python, Ruby, Scala, etc. BSON documents
GridFS for large binary files
Memory-mapped files Comparison Operators
($all, $gt, $gte, $in, $lt, $lte, $ne, $nin, $regex)
Logical Operators ($and, $nor, $not, $or)
Subdocuments
Arrays
Result Projections
Cursors
Aggregation
Geospacial Datatypes Array, Binary, Boolean, DateTime, DB Reference, Embedded Object, Integer, Null, ObjectId, RegExp, String, Symbol, Timestamp Great for Not Great for Highly Transactional Applications.
Problems requiring SQL. Read Update Insert Delete use cookbook;
db.recipes.insert({
'name': 'Cherry Pie
'ingredients': ['cherries', 'pie'],
'cooking_time': 30
});
db.recipes.save({
'name': 'Apple Pie',
'ingredients': ['apples', 'pie'],
'cooking_time': 30
}); Simple Queries
db.recipes.findOne();
db.recipes.find({
'cooking_time': {'$gte': 10, '$lt': 30}
});

Counting Results
db.recipes.count();

Skipping & Limiting Results
db.recipes.find().skip(5).limit(10); Sorting Results
db.recipes.find().sort({
'cooking_time': -1
});

Cursors
var cur = db.recipies.find().cursor();
cur.forEach(function(x) {
print(tojson(x));
}); db.recipes.update({
'name': 'Apple Pie',
{'$set': {'cooking_time': 45}},
true
}); $inc increment value {$inc: {field: value}}
$set set field to value {$set: {field: value}}
$unset delete field {$unset: {field: 1}}
$push add value to field {$push: {field: value}}
$pushAll add array to field {$pushAll: {field: array}}
$pop remove last / first element from array {$pop: {field: 1/-1}}
$pull remove all values from array {$pull: {field: value}}
$rename rename field {$rename: {old_name: new_name}} db.recipes.remove({
'name': 'Apple Pie'
});
db.recipes.remove();
Full transcript