Tag-aware Sharding commands
use dbversity db.nosql.ensureIndex({“mongodb” : 1}) db.rbdms.ensureIndex({“oracle” : 1}) db.newsql.ensureIndex({“memsql” : 1}) sh.enableSharding(“dbversity”) use admin db.runCommand({shardCollection: “dbversity.nosql”, key : {“mongodb”:1}}) db.runCommand({shardCollection: “dbversity.rbdms”, key : {“oracle”:1}}) db.runCommand({shardCollection: “dbversity.newsql”, key : {“memsql”:1}}) sh.startBalancer() sh.isBalancerRunning() sh.getBalancerState() for (var i=0; i
WiredTiger’s weird bugs
MognoDB Inc has identified a bug in MongoDB 3.0 where, under very rare circumstances, an integer overflow condition may cause a replica set to become read-only. While this bug does not cause any data loss, it has the potential to cause…
MongoDB ReplSetTest()
replSetTest is an internal command that is not enabled by default. replSetTest must be enabled by using –setParameter enableTestCommands=1 on the mongod command line. replSetTestcannot be enabled during run-time. > var rst = new ReplSetTest( { name: ‘rsTest’, nodes:…
The Software Engineer’s Online Handbook
Toptal has compiled the best free online resources for engineers in 2016. Engineers of all experience levels will find great tools for collaboration, open source projects, and free tutorials. Stay a step ahead with emerging industry trends and hiring forecasts,…
MongoDB Sharding Best Practices
MongoDB Sharding is a complex operation for the db cluster and below are the reasons to shard. Whole data doesn’t fit on one server’s storage (Disk Space) Disk IO & CPU Working set doesn’t fit in one server’s RAM Write…
Using $min and $max on shard key doesn’t target queries ?
Using $gte and $lt on the shard key fields inside a query will cause it the query to be targeted to only the appropriate shards. However, using the $min and $max query operators (while hinting on the shard key) doesn’t…
Shard key can not exceed 128 characters ?
Shard key can not exceed 128 characters, if you try so Mongo doesn’t create an Index for that Shard key and as a result such sharded collection without index for sharding key will case performance degradation. mongos> use sharding_test;…
$setOnInsert with a shard key – not possible ?
Having the collection empty, when trying to do an upsert using $setOnInsert on a shard key I get the following error: Can’t modify shard key’s value. field: card: 1.0 collection: vizvid.total_video_views mongos> db.dbversity.status() { “sharded” : true, “ns” : “dbfry.dbversity”,…
Full Text Search of Dialogues with Apache Lucene: A Tutorial
Apache Lucene is a Java library used for the full text search of documents, and is at the core of search servers such as Solr and Elasticsearch. It can also be embedded into Java applications, such as Android apps or web backends. While Lucene’s…
Full text search in MongoDB
This is a custom implementation created by the MongoDB developers as a specific index type, and is due to be launched as an experimental feature in MongoDB 2.4. It has features such as: Full text search as an index type…