background preloader

MongoDB

Facebook Twitter

A vendor-independent comparison of NoSQL databases: Cassandra, HBase, MongoDB, Riak ( - Software ) "The more alternatives, the more difficult the choice.

A vendor-independent comparison of NoSQL databases: Cassandra, HBase, MongoDB, Riak ( - Software )

" -- Abbe' D'Allanival In 2010, when the world became enchanted by the capabilities of cloud systems and new databases designed to serve them, a group of researchers from Yahoo decided to look into NoSQL. They developed the YCSB framework to assess the performance of new tools and find the best cases for their use. The results were published in the paper, "Benchmarking Cloud Serving Systems with YCSB. " The Yahoo guys did a great job, but like any paper, it could not include everything: Ï The research did not provide all the information we needed for our own analysis. IN THE NEWS: MySQL users caution against NoSQL fad As R&D engineers at Altoros Systems Inc., a big data specialist, we were inspired by Yahoo's endeavors and decided to add some effort of our own. What makes this research unique? In 2012, the number of NoSQL products reached 120-plus and the figure is still growing.

Tools, libraries and methods Each workload was defined by: Optimizing MongoDB Compound Indexes. Courtesy The Beinecke Library How do you create the best index for a complex MongoDB query?

Optimizing MongoDB Compound Indexes

I'll present a method specifically for queries that combine equality tests, sorts, and range filters, and demonstrate the best order for fields in a compound index. We'll look at the explain() output to see exactly how well it performs, and we'll see how the MongoDB query-optimizer selects an index. Contents: The Setup Let's pretend I'm building a comments system like Disqus on MongoDB. I want to query for non-anonymous comments with timestamps from 2 to 4, and order them by rating. Range Query We'll start with a simple range query for comments with timestamps from 2 to 4: There are three, obviously. explain() shows how Mongo found them: Here's how to read a MongoDB query plan: First look at the cursor type.

The explain() output is now: Now the cursor type is "BtreeCursor" plus the name of the index I made. Equality Plus Range Query When would nscanned be greater than n? Can I improve this plan? First. For the PHP Mind, Part 1. This is part one of a three part blog series by Mitch Pirtle.

for the PHP Mind, Part 1

We have covered a lot on the blog about MongoDB features, as well as many ways to utilize MongoDB from different languages. This is the first in a series of posts from the perspective of a PHP developer; and covers the gamut from getting started to advanced concepts. I’m not going to waste the first blog post getting you up and running with MongoDB and the PHP extension, as that whole process is documented quite beautifully: While we’re at it, you should also take advantage of the online documentation for MongoDB, as well as the reference for the MongoDB extension for PHP. Getting Started "So now what? " Notes on MongoDB, GridFS, sharding and deploying in the cloud. We‘ve been using MongoDB in production for about six months with YippieMove.

Notes on MongoDB, GridFS, sharding and deploying in the cloud

It’s been an interesting experience and we’ve learned a lot. Contrary to many MongoDB deployments, we primarily use it for storing files in GridFS. We switched over to MongoDB after searching for a good distributed file system for years. Prior to MongoDB we used a regular NFS share, sitting on top of a HAST-device. That worked great, but it didn’t allow us to scale horizontally the way a distributed file system allows. A Full Javascript Architecture, Part Three - MongoDB.

Introduction to MongoDB Presentation MongoDB presents itself as a scalable, high-performance, open source and document-oriented database written in C++.

A Full Javascript Architecture, Part Three - MongoDB

Each of the concepts behind the first three characteristics are well known so let's focus on the fourth one : document-oriented. To clearly understand this concept we need some basic MongoDB terminology. Since we are going to see a lot of JSON let's start right away : A document-oriented database is a database where each document in a same collection may have a totally different structure.

Because all the information of the same entity can be dynamically stored within a single document, joins operations are no longer needed in this type of database. Joins operations are really expensive, they require a strong consistency and a fixed schema. Data Types MongoDB uses BSON as the data storage and network transfer format. Its key advantage over XML and JSON is efficiency in term of space and compute time.

Advanced Features. An introduction to MongoDB. Utilisation de node.js avec mongoDB. Introduction. MongoDB wasn’t designed in a lab.

Introduction

We built MongoDB from our own experiences building large scale, high availability, robust systems. We didn’t start from scratch, we really tried to figure out what was broken, and tackle that. So the way I think about MongoDB is that if you take MySql, and change the data model from relational to document based, you get a lot of great features: embedded docs for speed, manageability, agile development with schema-less databases, easier horizontal scalability because joins aren’t as important. There are lots of things that work great in relational databases: indexes, dynamic queries and updates to name a few, and we haven’t changed much there. For example, the way you design your indexes in MongoDB should be exactly the way you do it in MySql or Oracle, you just have the option of indexing an embedded field. Operations MongoDB is a server process that runs on Linux, Windows and OS X.

MongoDB can also be configured for data replication. Home. Atomic Operations. Overview Write operations are atomic on the level of a single document: no single write operation can atomically affect more than one document or more than one collection.

Atomic Operations

When a single write operation modifies multiple documents, the operation as a whole is not atomic, and other operations may interleave. The modification of a single document, or record, is always atomic, even if the write operation modifies multiple sub-documents within the single record. No other operations are atomic; however, you can isolate a single write operation that affects multiple documents using the isolation operator. This document describes one method of updating documents only if the local copy of the document reflects the current state of the document in the database. The findAndModify() provides an isolated query and modify operation.Perform Two Phase CommitsCreate a unique index, to ensure that a key doesn’t exist when you insert it.

Update if Current.