MongoDB and PHP Resources
Just a couple of articles for the PHP programmers interested in MongoDB. In the past we’ve also published a quick guide to Zend and MongoDB.
☞ MongoDB Tutorial
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.
Covers:
- installation on Windows
- a MongoDB wrapper
- using the MongoDB wrapper for basic CRUD operations
☞ document databases (MongoDB + PHP tutorial)
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.
Covers:
- installation on Mac OS X
- basic CRUD operations
☞ Developing scalable PHP applications using MongoDB - PHP Classes
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.
Note: the page looks really bad so you’ll probably get a much better experience if using one of the following cleaned up versions: ☞ instapaper mobilizer or ☞ google mobilizer
Covers:
- basic intro to MongoDB
- basic CRUD operations
- an intro on MongoDB indexes
- storing files in MongoDB
- short Map-Reduce example
☞ Removing files from MongoDB with GridFS
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 useMongoDB::lastError().
☞ MongoDB + CodeIgniter 101 (Part 1)
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.
Covers:
- installation on Ubuntu
- installation of MongoDB PECL extension
- basic blog sample application
☞ Using MongoDB with CakePHP
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.
☞ Loading Drupal Nodes into MongoDB with Drush
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.