2 ms·
I am having trouble reconciling the following two quotations: "[MongoDB is] so simple and natural to use from dynamic languages" and: "In my test code, I had
by jeffdavis 16y ago
I am having trouble reconciling the following two quotations:
"[MongoDB is] so simple and natural to use from dynamic languages"
and:
"In my test code, I had an 'async' remove() call (ie. I didn’t wait for it to finish) and was then inserting new entries, and previous remove() happiliy removed them (all of them, or some, or none, depending on the race). Those were very confusing few hours."
- eldenbishop 16y agoThis is a language driver issue. By default, some language drivers for mongo use connection pools. When operating in this mode, five inserts will get processed by five different connections in an arbitrary order. The advantages are speed and no need for managing connections (ie. try { getConnection() } finally { freeConnection() }. Thus in default usage, no leaked connections and speed is great but this behavior is very surprising when you learn about it as it is not at all obvious.