Questions tagged [sharding]

Sharding is a technique of partitioning database tables by row ("horizontally"); typically this technique requires a key to be selected that determines how the rows are to be partitioned.

Sharding is a concept in database design; it refers to the technique of physically partitioning a table or collection by row (also known as horizontal partitioning). To execute the partition, a key or key collection must be defined, which tells the database engine how to determine to which partition each record should belong.

References

1666 questions
0
votes
1 answer

Sharding on single machine

I want to run shard on my local server. please help me step by step. I want to create multi instance of mongod on my cpu(16 core). By the way, I'm Collection that consist of 7 million documents, whether they went missing when I run shard? I use this…
user255327
  • 47
  • 1
  • 6
0
votes
1 answer

Issue When I set shard key

I have a collection and I set shard it. I have errors while I add a shard key!!! mongos> sh.shardCollection('IBSng.connection_log', {login_time:1}) But I was shown this error: Even I set compound shard with logout_time field with login_time, But…
user255327
  • 47
  • 1
  • 6
0
votes
1 answer

How to get table , ID information from Scala Slick Query object

val users = TableQuery[Users] val query = for( user <- Users.filter(_.id === 1L) ) yield user println(query.toNode.nodeChildNames.toBuffer) gives something like this => ArrayBuffer(from @1276230271, select) How to get user id information from…
Nagarjuna Pamu
  • 14,737
  • 3
  • 22
  • 40
0
votes
1 answer

MongoDB sharding, arbiter and cluster setup

Could someone help validate our setup Setting up a 4 node MongoDB cluster 1 primary (write ) , 3 secondaries (read) if primary goes down, 3 secondaries can break tie and elect a secondary to primary Will this setup work? is an arbiter required in…
restack
  • 33
  • 4
0
votes
1 answer

How to perform MongoDB CRUD operations through javascript?

I'm trying to automate modifications made on tag ranges. But I keep getting an "SyntaxError: Unexpected identifier at ..." error at the first 'db.tags.remove...'. ... today = yyyy+mm+dd; balancing = sh.getBalancerState(); if (! balancing) { …
Icu
  • 103
  • 1
0
votes
1 answer

In PyMongo, given a mongos, what is the difference between normal and RS clients?

PyMongo has a MongoClient for connecting to single nodes, and a MongoReplicaSetClient for connecting to entire replica sets; the latter is able to route reads to secondaries and monitor set health. But what is the difference if I connect to a mongos…
Vasiliy Faronov
  • 11,840
  • 2
  • 38
  • 49
0
votes
1 answer

elasticsearch logstash 100% cpu actives shards 300++

When I launch elasticsearch (with logstash), it consumes 100% of the CPU. If I check the status of the cluster I can see { "cluster_name": "elasticsearch", "status": "red", "timed_out": false, "number_of_nodes": 2, …
0
votes
1 answer

websql performance, can we shard tables

I am using websql to store data in a phonegap application. One of table have a lot of data say from 2000 to 10000 rows. So when I read from this table, which is just a simple select statement it is very slow. I then debug and found that as the size…
Abhishek bhutra
  • 1,400
  • 1
  • 11
  • 29
0
votes
2 answers

Unable to Shard Data

I am stuck with a problem regarding MongoDB sharding. My test setup is given below- 1.Application Server(1 server) -Where my application is running. 2.MongoS & Router(1 server) 3.Two Shards-Primary shard contains the complete DB & Secondary shard is…
ratr
  • 606
  • 1
  • 9
  • 24
0
votes
1 answer

MongoDB sharding for data warehouse

Sharding provide a scalable throughput and storage. Scalable throughput and storage is kind of a paradise for analytics. However there is a huge trade off that I think about. If I use hashed shard key, - write will be very scalable - however, if I…
rendybjunior
  • 572
  • 6
  • 19
0
votes
1 answer

Sharding on MongoDB what about the other collections?

I understand that 'Hash Sharding' can be done on the collection level on a database on based on the key of the collection that is passed. This ensures that records for that collection are distributed across all the shards. I understand what happens…
codeHead
  • 69
  • 9
0
votes
1 answer

why shardCollection command not working in mongo shell script

i am trying to execute the following command within mongo shell script : sh.shardCollection('mydb.collection', { shardKey : 1 }); but it does not do anything. However When i execute from script : print(sh.help()) I get all the help options. So…
codeofnode
  • 18,169
  • 29
  • 85
  • 142
0
votes
1 answer

How to migrate any single mongodb database into various databases for sharding.?

I have a mongo database 'db-all'. And i have many collections and i have filled up large number of documents in each collections. there are 9 collections, in which each collection have a 'shardKey' field type of mongoObjectId. and one collection is…
codeofnode
  • 18,169
  • 29
  • 85
  • 142
0
votes
2 answers

how to execute read only query on sharded replica set in mongodb

Consider following configuration - 2 Shard server each has 1-replica set (say rs0 and rs1). 3 config server and 1 query router (mongos) The above sharding configuration is working fine. But, i want to execute read-only query from sharded replica…
Bittu
  • 48
  • 7
0
votes
0 answers

MongoDB shard key for emails collection

I'm using MongoDB 2.6.1 I have a collection that stores the emails, project-wise. The documents are as follows(haven't included the 'Raw Email Text' key for readability) : { "_id" : ObjectId("540d4ae7eea013be22f1f0d6"), "Project_Id"…
Kaliyug Antagonist
  • 3,512
  • 9
  • 51
  • 103
1 2 3
99
100