MongoDB strikes a balance between the familiarity and ease of use of MySQL, and the freeness and performance offered by document storage databases. The database has no set schema so you can add, remove and modify the structure of your documents without having to issue an UPDATE statement.
- installation on Windows
- a MongoDB wrapper
- using the MongoDB wrapper for basic CRUD operations
With document-oriented databases this is not the case. You just create a database and start developing. Every time you need to save some data, you just create a document, add the fields you need (for a shopping card you’d probably save a user_id, date, price, all the items, …) and save it to the database.
- installation on Mac OS X
- basic CRUD operations
Nowadays there is a new kind of databases that is getting very popular, specially for Web development, including the PHP world, which are the NoSQL databases.
This article focus specifically on MongoDB, despite there are several other NoSQL database implementations.
- basic intro to MongoDB
- basic CRUD operations
- an intro on MongoDB indexes
- storing files in MongoDB
- short Map-Reduce example
A tip on how to check file removal worked as expected:
Yes, you already figured out it’s as simple as
$grid->remove(). Here is something to keep in mind.
MongoGridFS::removewon’t present you with a message if it failed. To ensure that a file was successfully removed use
So I’ve decided that I want to properly document my MongoDB exploration and I may as well help others to learn with me. […] What I’m going to do here in part 1 is install MongoDB, install the PECL PHP extension and just play around a bit.
- installation on Ubuntu
- installation of MongoDB PECL extension
- basic blog sample application
I originally intended to sit down and start writing a Mongo datasource only to find that Yasushi Ichikaway had totally beat me to it, and written a great datasource. So instead, I’ll write about how you can get up and running with MongoDB.
A very basic example.
To do some prototyping, I wanted to load all 32k of our Drupal nodes into MongoDB. At first, the thought of doing this seemed daunting. Then I realized that with Drush I could use a very simple script to perform an entire migration. The result: With a 14 line PHP script, I transferred all of the nodes (CCK, taxonomy, and all) without a glitch.
I bet there are more such resources about MongoDB and PHP, but I hope these are will be a good start for every PHP programmer interested in MongoDB.
Disclaimer: I am not very familiar with the PHP development so the above articles were picked based on Twitter reactions.