MongoDB Tag-aware sharding script
Commands : use dbversity sh.status() sh.enableSharding(“dbversity”) db.nosql.ensureIndex({“mongodb” : 1}) db.rdbms.ensureIndex({“oracle” : 1}) db.newsql.ensureIndex({“memsql” : 1}) show collections sh.status() sh.shardCollection(“dbversity.nosql”, {mongodb:1}); sh.shardCollection(“dbversity.rdbms”, {oracle:1}); sh.shardCollection(“dbversity.newsql”, {memsql:1}); sh.status() for (var i=0; i<100000; i++) { db[“nosql”].insert({mongodb: Math.random(), count: i, time: new Date()}); } for…
Why MongoDB Compass ?!
Know your data with seamless schema visualization MongoDB Compass analyzes your documents and displays rich structures within your collections in a simple and intuitive GUI. It allows you to quickly visualize and explore your schema to understand the frequency, types…
set/unset the fields with another fields in mongo
Question : How can I update a field with another field value in the same document (in both array & embedded sub documents) From the attached JSON document, I would like to update ‘analyticUsers.geid’ to : ‘analyticUsers._id’ & tried all…
MongoDB WT with ext4 Filesystem and its performance issues.
Currently MongoDB Inc., is lacking in a comprehensive explanation of the issues that can arise with WT when running on EXT4. Specifically, details on what the issue is, under what conditions it can manifest, and what the symptoms are. They’ve…
How to Set up a Microservices Architecture in Ruby: A Step by Step Guide
What Are Microservices? Microservices are one of the latest trends in software design where multiple independent services communicate among themselves and have their own processes and resources. This approach differs from a typical client-server application design. The usual client-server application…
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…