Ten things I didn’t know about MongoDB
slowping.com
slowping.com
1- While you can select only specific fields by using {fieldA: 1, fieldB: 1} as a 2nd parameter to find, you can also exclude fields using -1. Interestingly though, you can't mix inclusion or exclusion (which makes sense if you think about it), except to exclude _id. So {name: 1, description: 1, _id: -1} is possible.
2- Sending SIGUSR1 to the running mongod process will rotate the logs
3- We got a 25% memory/storage reduction by shrinking our field names. YMMV. I knew how data was stored, but I didn't know what amount we would specifically save :P
4- Count returns the value of found documents regardless of paging. This lets you pull documents + get total # very easily. If you pass true to count, you'll get the actual returned # of documents.
5- Replica sets either have a priority of 0 or 1...future versions will introduce more flexibility
P.S. Your ebook and tutorial are great resources. Thanks for sharing!!
I really wish they just had an internal lookup table to do that. I don't want to have to deal with keys like "c1, ba, la" in my application.
edit: I suppose I should have expected to be downvoted -- I'll elaborate on my thoughts.
The folk who wrote things in the pre-CAP theorem era were not ignorant of the problems of scale. They did their best to attack them and did an amazing job of it.
If you remove constraints, then yes, you can improve performance. But soon you will discover why and how those constraints were imposed in the first place.
The implementers of Mongo are, less some genuine advances, doomed to repeat history per Santayana.
Riak also has no master!
http://www.korokithakis.net/posts/my-experience-with-using-m...
There is a group() function, and there is Map Reduce, but since they both run via the JavaScript engine and the nature of JavaScript is single-threaded that means that you can never execute more than one of the aggregation queries at a time. So if an aggregation query is taking a long time to run, all other queries will block and potentially timeout.
Supposedly we'll have better options in 2.0.
1- Eliminate any memory limits on inline map reduce, or bring back output to temporary collections. If they bring back output to temporary tables, allow them to be run on slaves and not participate in replication
2- Polished and released a production-ready version of their MongoDB Hadoop Adapter: https://github.com/mongodb/mongo-hadoop
I'd love to run it alongside a ElasticSearch process and a small redis server on a machine, but while I can limit ElasticSearch and I could theoretically limit Redis, MongoDB would just grow as far as I understood (mmapped I/O). I'd love to use it as a second copy of the data in ElasticSearch
MongoDB won't starve other processes of memory unless the OS decides it should. It seems like the best way to leverage the most amount of available memory.