I want to implement mongodb as a distributed database but i cannot find good tutorials for it. Whenever i searched for distributed database in mongodb, it gives me links of sharding, so i am confused if both of them are the same things?
is sharding same as distributed database in mongoDB?
3.8k Views Asked by sanchit kashyap AtThere are 2 best solutions below
vmr
On
Just some perspective on distributed databases:
In early nineties a lot of applications were desktop based and had a local database which contained MB/GBs of data.
Now with the advent of web based applications there can be millions of users who use and store their data, this data can run into GB/TB/PB. Storing all this data on a single server is economically expensive so there is a cluster of servers(or commodity hardware) across which data is horizontally partitioned. Sharding is another term for horizontal partitioning of data. For example you have a Customer table which contains 100 rows, you want to shard it across 4 servers, you can pick 'key' based sharding in which customers will be distributed as follows: SHARD-1(1-25),SHARD-2(26-50),SHARD-3(51-75),SHARD-4(76-100)
Sharding can be done in 2 ways:
Hash based
Key based
Related Questions in MONGODB
- Meteor MapReduce Package Error: A method named is already defined
- Token based authorization in nodejs/ExpressJs and Angular(Single Page Application)
- Big data with spatial queries/indexing
- How to recover from losing all your /data/db
- What are the benefits of using the fields option when querying in Meteor
- Node JS Async Response
- mongoose get property from nested schema after `group`
- What to use for subdocuments ID's in MongoDB?
- ORM Code First versa Database First in Production
- How to profile a Yii2 based API?
- get length of embedded document in mongoDB with jade
- Architecture: Multiple Mongo databases+connections vs multiple collections with Express
- Why are numbers being inserted into MongoDB incorrectly?
- hibernate ogm mongo db, how to get count of collection?
- C++ Mongodb driver, not working
Related Questions in VIRTUALBOX
- Only 32 bit available in Oracle VM - Hadoop Installation
- How to access Guest's port 3000 from Host?
- vagrant, docker, shared volume not ready on initial provisioning
- scp between two virtual machines in virtualbox
- homestead up not working after vagrant up
- Win7 Virtualbox is giving this error when trying to launch a vm: Error loading 'crypt32.dll': 1790
- VirtualBox: VERR_VMX_MSR_VMXON_DISABLED
- Virtual Box MySQL Server VM constantly timing out
- Docker inside Windows guest virtual machine
- Guest CentOS in virtualbox failed to load GNOME Power manager
- VirtualBox machine - Set to access LAN only
- Virtualbox on Genymotion show an Error when i tried to install it
- Oracle VirtualBox terminated unexpectedly, with exit code -1073741819 (0xc0000005)
- How to change default Nginx setting on Homestead Laravel Virtualbox VM
- is sharding same as distributed database in mongoDB?
Related Questions in DISTRIBUTED
- Fill an array with spmd in Matlab
- Hazelcast Distributed Lock with iMap
- is sharding same as distributed database in mongoDB?
- How to start distributed Erlang app without starting dependencies at every node?
- Spark tasks doesn't seem to be well distributed
- OrientDB to automatically create databases on startup
- Unequal distribution of packets in distributed system
- Logical Clocks: Lamport Timestamps
- MPI Random Broadcasting
- Hazelcast (Java) and ETCD (golang) differences/similarities?
- IP addresses in distributed systems
- Usage of RemoteCache with DeltaAware and Delta interface infinispan
- How to achieve similar color distribution with fewer pixels?
- How can I ensure a periodic task will run forever on a linux machine?
- Warning that "unknown addresses are found in partition table"
Related Questions in SHARDING
- Better practice for huge size of table on Ruby on Rails 4 / ActiveRecord
- How to deploy three config server instances for sharding in mongodb?
- Multiple mongodb servers seen as one and data flow management
- mongodb shard geo documents
- MongoDB - Loading data into sharded DB with balancer on
- How to do sharding and replication of Orient DB database
- Mongodb sharding: Chunk split failed with Hashed Shard Key
- is sharding same as distributed database in mongoDB?
- Setup elastic for production
- how to clear out garbage tables from broken mongodb shard
- MongoDB shard by date on a single machine
- Ruby gem or snippet to use different ActiveRecord db connection depending on model attribute value
- MongoDB 4 Shards in a Sharding Cluster but there is only using 3 and it's not well distribuited
- MongoDB how to become master
- Rebalancing a table shard, with MySQL/InnoDB
Related Questions in DATABASE
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- How to not load all database records in my TListbox in Firemonkey Delphi XE8
- microsoft odbc driver manager data source name not found and no default driver specified
- Cloud Connection with Java Window application
- Automatic background scan if user edit column?
- Jmeter JDBC Connection Configuration Parametrization of Database URL for accessing SQL Database
- How to grant privileges to current user
- MySQL: Insert a new row at a specific primary key, or alternately, bump all subsequent rows down?
- Inserting and returning autoidentity in SQLite3
- Architecture: Multiple Mongo databases+connections vs multiple collections with Express
- SQL - Adding a flag based on results within a query - best practice?
- Android database query not returning any results
- Developing a search and tag heavy website
- Oracle stored procedure wrapping compile error with inline comments
- Problems communicating with mysql in php
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Generally speaking, if you got a read-heavy system, you may want to use replication. Which is 1
primarywith at most 50secondaries. Thesecondariesshare the read stress while theprimarytakes care of writes. It is a auto-failover system so that when theprimaryis down, one of thesecondarieswould take the job there and becomes a newprimary.Sharding, however, is more flexible. All the
Shardsshare write stress and read stress. That is to say, data are distributed into differentShards. And each shard can be consists of aReplicationsystem and auto-failover works as described above.I would choose
replicationfirst because it's simple and is basically enough for most scenarios. And once it's not enough, you can choose to convert from replication to sharding.There is also another discussion of differences between replication and sharding for your reference.