As the title suggests, is using a second database for write heavy data a good option in Mongo? For example, for votes (voting on objects like stack overflow questions) and page views information would it make sense to keep a second database with documents that reference objects in the first database?
Or would it make more sense to just put everything in a single database?
I know that for writes that don’t need to be immediately shown to the user (like writing and updating a pageview count) many applications write the data to a intermediate layer like memcache and then bulk update the database on an interval. I’d like to avoid creating a system like this for now.
If with “second database” you mean a second mongod process to reduce write lock contention then yes, your solution will help. Note that sharding basically offers additional write (and read) throughput as well but is much more flexible and application agnostic.
If you mean creating a second database on your single mongod process then that will not help at all. Mongo write locks are mongod process wide.
UPDATE : As of MongoDB 2.2 write locking happens at database rather than process level and this would result in write lock contention being reduced if you use multiple logical databases.