[SERVER-9250] using bucket to group small docs Created: 04/Apr/13 Updated: 10/Dec/14 Resolved: 10/Apr/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | hui luan | Assignee: | Stennie Steneker (Inactive) |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
osx 10.8.3 |
||
| Participants: |
| Description |
|
We have a collection to store user activity, in terms of who did what at what time. The access to this collection will be user based, and fetch from latest to oldest. The doc looks like We are considering to group such tiny doc into an array in one doc, which turns it to be, { We thought this will give better storage since number of documents is reduced, indexes should be smaller. While reading, the number of documents to seek is also reduced, thus read should be faster. However, when I ran a testing script thru shell to test this schema for reading and writing, I see with larger bucket size the storage is actually higher and insertion is higher. The raw doc without bucketing give highest insertion rate with relatively increase in storage size. So my question is, is it a good design to group documents together into buckets, especially large bucket like 100 – 500? And dose the number of documents matter, say we have 10 million users all using this product with each having 100 activities, the doc number will go up to 1 billion. My testing script and result is as below, Big = 500 per array > load('bucket.js') script, var d = db.getSisterDB("bucket_test"); var total = 10000; ); }}, true); } return t; var insrt = function(usecase , col, count){ ); } return t; var bigDoc = d.big.findOne(); var smallDoc = d.small.findOne(); var rawDoc = d.no_bucket.findOne(); |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 10/Apr/13 ] |
|
Hi, The SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion you should post on the mongodb-users group (http://groups.google.com/group/mongodb-user) or Stack Overflow / ServerFault. Thanks, |