Skip to content

MongoDB Concurrency

prohaska edited this page Apr 15, 2013 · 20 revisions

This wiki describes the concurrency seen by MongoDB 2.4 applications.

Concurrency

MongoDB allows concurrent queries on any collection in any database

  • Query database(a).collection() || Query database(a).collection()
  • Query database(a).collection() || Query database(b).collection(), a != b

MongoDB does not allow concurrent insertions to the same database

  • Insert database(a).collection() blocks Insert database(a).collection()

MongoDB does allow concurrent insertions to different databases

  • Insert database(a).collection() || Insert database(b).collection(), a != b

MongoDB queries block insertions to the same database

  • Query database(a).collection() blocks Insert database(a).collection()

MongoDB insertions block queries in the same database

  • Insert database(a).collection() blocks Query database(a).collection()

MongoDB allows concurrent insertions and queries in different databases

  • Insert database(a).collection() || Query database(b).collection(), a != b
  • Query database(a).collection() || Insert database(b).collection(), a != b

MongoDB does not allow concurrent queries with dropping the collection

  • Query database(a).collection(b) blocks database(a).collection(b).drop
Clone this wiki locally