background preloader

Recherches sur MongoDB

Facebook Twitter

What's new in MongoDb 3.0. Mongodb/mongo-php-driver. Database - Pros and cons of MongoDB? Valhalla Articles - The Pros and Cons of MongoDB. A lot of people are making the switch to MongoDB, however many have neglected to (or outright refuse to) weigh the pros and cons of such a decision.

Valhalla Articles - The Pros and Cons of MongoDB

As a relatively new and unfamiliar technology, it can have catastrophic effects when attempting to implement in a production system. In light of this, I've attepted to conduct some research on the topic to find out exactly why one should or shouldn't (or under which circumstances one should) use MongoDB in place of a traditional relational database. Background Information MongoDB is a document-based NoSQL database. Documents are JSON-style data structures composed of field-and-value pairs for example: MongoDB stores documents on disk in the BSON serialization format. A document database has many advantages, but before selecting to use one you should verify that your data fits a document model. One would likely argue that data such as a forum with users, threads, and posts is definitely more relational data.

Advantages Disadvantages Conclusion. What are the disadvantages of using MongoDB over MySQL? - Quora. Why is MongoDB wildly popular? It's a data structure thing. Updated 11/7/14: Fixed typos “Show me your code and conceal your data structures, and I shall continue to be mystified.

Why is MongoDB wildly popular? It's a data structure thing.

Show me your data structures, and I won’t usually need your code; it’ll be obvious.” – Eric Raymond, in The Cathedral and the Bazaar, 1997 Linguistic innovation The fundamental task of programming is telling a computer how to do something. Because of this, much of the innovation in the field of software development has been linguistic innovation; that is, innovation in the ease and effectiveness with which a programmer is able to instruct a computer system. While machines operate in binary, we don’t talk to them that way. The Object-Relational impedance mismatch Almost all modern programming languages support OO, and when we model entities in our code, we usually model them using a composition of primitive types (ints, strings, etc…), arrays, and objects.

The data structures we use to persist data have not evolved at the same rate. Ted Neward hit it spot on when he said: MongoDB. Popularity ranking of database management systems. Unique Indexes — MongoDB Manual 3.0.4. A unique index causes MongoDB to reject all documents that contain a duplicate value for the indexed field.

Unique Indexes — MongoDB Manual 3.0.4

To create a unique index, use the db.collection.createIndex() method with the unique option set to true. For example, to create a unique index on the user_id field of the members collection, use the following operation in the mongo shell: By default, unique is false on MongoDB indexes. If you use the unique constraint on a compound index, then MongoDB will enforce uniqueness on the combination of values rather than the individual value for any or all values of the key. Unique Constraint Across Separate Documents The unique constraint applies to separate documents in the collection. For example, a collection has a unique index on a.b: The unique index permits the insertion of the following document into the collection if no other document in the collection has the a.b value of 5: Unique Index and Missing Field Restrictions. MySQL vs MongoDB. MySQL and MongoDB represent two sides of an argument that has been raging recently concerning data storage – the tried and tested relational database vs. non-relational or NoSQL database.

MySQL vs MongoDB

They are both open-source products distributed under a version of the GNU GPL, and both are also available as commercial versions offering many more features and corporate support. Relational vs. Non-relational Databases Let’s first digress from our two combatants and look at the relational-vs-nonrelational argument for a bit. Relational SQL databases have been around since the 1970’s, invented by the brilliant E.F. However, what SQL and relational databases are not good at is scaling. So is there a business need that has come up recently in which we now need several servers, rather than one large, massively powerful server?

Hence the emergence of non-relationa or NoSQL databases. Customer_name Andrew JonesCustomer_gender MCustomer_Current_account_bal $28,400 MySQL Now back to the original discussion.