Category Archives: MongoDB

Document database shootout: MongoDB vs. CouchBase

MongoDB and CouchBase are both document stores that together dominate the market of document databases.  MongoDB is a clear leader in terms of market share and CouchBase is the Challenger. I wanted to check which performs better and if CouchBase is a real alternative to MongoDB. The answer to “which is a better database” is… Read More »

Storing binary data in MongoDB with GridFS

MongoDB provides two ways for storing binary data. The first one is the Binary data type which can store objects up to 16KB in size in a regular document. However, for larger files MongoDB offers GridFS, a filesystem like collection that can store very large files and can also be sharded and distributed across the… Read More »

Storing geospatial data in MongoDB

For this post I used MongoDB 3.4 community edition. MongoDB has a native support for storing, indexing and querying geospatial data. Until version 2.4 it could only deal with Longitude/Latitude pairs and some basic functions. Some support for GeoJSON was added in version 2.4 and version 2.6 added full support for GeoJSON, but the legacy… Read More »

Installing MongoDB 3.4 on Linux – from standalone to sharded cluster

For this post I used MongoDB 3.4 open source edition and Centos 6.8 machines. OS Preparations First, we have to increase some default OS limits, mainly number of threads and number of open files: vi /etc/security/limits.conf mongod hard nproc 64000 mongod soft nproc 32000 mongod hard nofile 64000 mongod soft nofule 64000   Then we have… Read More »