48 karma · joined December 22, 2009
1. Since Mongo has a database (or maybe collection now) level lock, doing rebalancing under a heavy write load is impossible.
3. Mongos creates one thread per connection. This means that if you've got to be very careful about the number of clients you start up at any given time (or in total).
1. Add individual nodes to the cluster and have it automatically rebalance over the new nodes.
2. Have it function without intervention in the face of node failure and network partitions.
3. Query any node in the cluster for any data point (even if it doesn't have that data locally).
I'm sure there's other things I'm missing, but the point made by timdoug is the key one. We're at a scale now where it's worth trading up-front application code for reliability and stability down the line.
[1] https://github.com/wmoss/Key-Value-Polyglot
[2] diesel.io
[3] https://github.com/jamwt/diesel
[4] The first run is against the diesel one
wmoss@wmoss-mba:~/etc/Key-Value-Polyglot$ time python test.py
real 0m0.134s
user 0m0.040s
sys 0m0.020s
wmoss@wmoss-mba:~/etc/Key-Value-Polyglot$ time python test.py
real 0m20.164s
user 0m0.096s
sys 0m0.072s
Level also has to look down the entire tree if a key is missing. This means inserts end up being more expensive than reads or updates (which are all just a hash lookup in Bitcask).
* If I want to ensure that my data is written to three machines, all my writes will stop working in MongoDB if one machine goes down. With Riak, it will start issuing the writes to another node in the cluster and rebalance when the missing node comes back online.
* If I'm running MongoDB in a sharded configuration, if one of the shards cannot be reached, all writes will stop. With Riak, any node will accept the writes and, once the network issues are resolved, move them to the appropriate node.
That said, conflict resolution is hard and there's no real way to get around it when you're using a distributed database like Riak. With Riak, as Chad says you get "increased development complexity for massively decreased deployment complexity." There's no silver bullet, it's important to look at the trade-offs of each option.
My sources at Basho tell me that this is fixed in 1.0, but until that's officially released, basically don't try to list keys.