Wednesday, January 16, 2013

mongodb: sharding


mongos - shard router (router to distributed mongodb servers)
app -> mongos -> mongodb's
config ---^
(do mulitiple config servers)

chunks 64mb by default

using shard key routes request to specific shard, else scattered request happens
scattered - broadcast to multiple shards

* you can store photos in mongodb by using BinData(...)

auto increment is not a good shard key because it writes to the same shard. md5hash is good on distribution of shards.

index that starts with shard key is needed for unique identification accross db

steps from replica set to sharded cluster
1. start 3 config servers
2. start mongos and point to config server
3. add replica set to shard
4. point app to mongos

i read somewhere that there exists a shard setup of 600 mongodb servers

not anybody needs sharding. to some replica set is enough.

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...