Simon Willison’s Weblog


10 items tagged “mongodb”


What are the advantages and disadvantages of using MongoDB vs CouchDB vs Cassandra vs Redis?

I see Redis as a different category from the other three—kind of like you wouldn’t say “what are the advantages of MySQL v.s. Memcached”. Redis makes an excellent complement to pretty much any other persistent storage mechanism. I expanded on this here:

[... 67 words]

What is the best way to integrate MongoDB with Django?

Personally, I just “import pymongo” and start calling the regular Python API—no need for any special treatment to get it working with Django.

[... 41 words]

Geospatial Indexing in MongoDB (via) New in version 1.3.3. Handles “order by distance from” queries using a geohash approach under the hood, automatically searching nearby grid squares until the correct number of results have been gathered. Bounding box search is planned for a future release.

# 2nd March 2010, 8:12 pm / geohash, geospatial, gis, mongodb

Notes from a production MongoDB deployment. Notes from running MongoDB for 8 months in production, with 664 million documents spread across 72 GB master and slave servers located in two different data centers.

# 28th February 2010, 11:05 pm / mongodb, scaling, sysadmin


“MongoDB is fantastic for logging”. Sounds tempting... high performance inserts, JSON structured records and capped collections if you only want to keep the past X entries. If you care about older historic data but still want to preserve space you could run periodic jobs to roll up log entries in to summarised records. It shouldn’t be too hard to write a command-line script that hooks in to Apache’s logging directive and writes records to MongoDB.

# 26th August 2009, 7:09 pm / apache, json, logging, mongodb

Why we migrated from MySQL to MongoDB. Includes some useful information on MongoDB’s limitations—for example, running many different collections can waste disk space and repairing large datasets or bulk deleting many rows can block and lock the database for the duration of the operation.

# 27th July 2009, 10:49 am / databases, documentstores, mongodb, mysql

TurboGears on Sourceforge. Sourceforge recently relaunched, powered by TurboGears 2 and MongoDB. Mark Ramm has the details.

# 17th July 2009, 2:30 am / mark-ramm, mongodb, sourceforge, turbogears, turbogears2

Using Mongo for Real-Time Analytics. MongoDB supports an “upsert” query, which when combined with the $inc operator can cause counter fields to be incremented if they exist and created otherwise. This makes it a great fit for real-time analytics applications (one increment per page view), something that regular relational databases aren’t particularly good at.

# 30th June 2009, 7:28 pm / counters, databases, increment, mongodb, upsert

MongoDB. Lots of discussions about this at EuroPython today—it’s a document database, very similar to CouchDB but significantly faster and suggested for production use. Best of all, trying it out on OS X is as easy as extracting the tarball and running “bin/mongod --dbpath /tmp/test-mongo-db run”.

# 30th June 2009, 7:13 pm / couchdb, documentstore, europython, json, keyvaluestore, mongodb, nonrelationaldatabase, osx

MongoDB—Capped Collections. Collections with a size limit that automatically expire older entries are interesting—useful for things like a “recent searches on this site” feature.

# 7th June 2009, 12:50 pm / cappedcollections, mongodb, search