Skip to main content

Posts

Showing posts from 2015

Sharding Methods For MongoDB

Sharding Introduction Sharding is a method for storing data across multiple machines. Sharding , or horizontal scaling , by contrast, divides the data set and distributes the data over multiple servers, or shards . Each shard is an independent database, and collectively, the shards make up a single logical database. Sharding in MongoDB MongoDB supports sharding through the configuration of a sharded clusters . Components in Sharded Cluster : Shard Query Routers Config Servers Shards store the data. To provide high availability and data consistency, in a production sharded cluster, each shard is a replica set . Query Routers , or mongos instances, interface with client applications and direct operations to the appropriate shard or shards. The query router processes and targets operations to shards and then returns results to the clients. A sharded cluster can contain more than one query router to divide the client request load. A client sends ...

MongoDb with PHP on Windows

MongoDb Installation Download MongoDB from official MongoDB website . Choose Windows 32 bits or 64 bits. In Windows Explorer, locate the downloaded MongoDB .msi file, which typically is located in the default Downloads folder. Double-click the .msi file. A set of screens will appear to guide you through the installation process. You may specify an installation directory if you choose the “Custom” installation option. These instructions assume that you have installed MongoDB to C:\mongodb . MongoDB is self-contained and does not have any other system dependencies. You can run MongoDB from any folder you choose. You may install MongoDB in any folder (e.g. D:\test\mongodb ). 1.Set up the MongoDB environment MongoDB requires a data directory to store all data. MongoDB’s default data directory path is \data\db . Create this folder using the following commands from a Command Prompt : md  \data\db You can specify an alternate path for data files using the --dbpath ...