Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Sorting across collection strategies
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
danpolites  
View profile  
 More options May 3 2012, 3:58 pm
From: danpolites <dpoli...@gmail.com>
Date: Thu, 3 May 2012 12:58:42 -0700 (PDT)
Local: Thurs, May 3 2012 3:58 pm
Subject: Sorting across collection strategies

We have been using Mongo for over a year now and everything has been great
with it. It works perfectly for our dynamic objects and it has been easy to
maintain. The problem that we are running into now is with reporting. We
basically need to provide reports across our entire system to our users. My
thought was to use something like Redis in front of mongo to cache the user
information for these reports, but now I am stuck on the sorting for this
information. If we were to denormalize the data, we would have user
information copied across 20-30 collections. That just sounds like a
nightmare to maintain and keep up-to-date. Pulling the data out into our
application and sorting that way could potentially lead to performance
issues due to the amount of data that could possible be returned over a
year and the amount of users accessing reports at that time. So here is
what I'm trying to solved.

user collection

{firstName:'John', lastName:'Smith', id:'123abc'}
{firstName:'Andy', lastName:'Smith', id:'123def'}

report collection 1  (assume millions of records and many more fields)

{someCount:34, someScore, 23, userId:'123abc'}
{someCount:1 someScore, 12, userId:'123def'}

report collection 2 (assume millions of records and many more fields)

{someCount:1 someScore, 12, userId:'123abc'}
{someCount:1 someScore, 12, userId:'123def'}

and so on

Let's say I want to put data from report collection 2 into jqGrid. How can
I sort that information on the user's first name/last name.
Andy Smith 1 12
John Smith 1 12

At this point it's looking like we need to, at the very least, move our
user information and reporting data to a relational database. I would
rather not maintain two databases, however. Thoughts?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brandon Diamond  
View profile  
 More options May 4 2012, 1:29 pm
From: Brandon Diamond <bran...@10gen.com>
Date: Fri, 4 May 2012 10:29:42 -0700 (PDT)
Local: Fri, May 4 2012 1:29 pm
Subject: Re: Sorting across collection strategies
I'm not sure I understand the problem.

MongoDB supports arbitrary ordering and limiting. Sorting can be made
more efficient using an index. If you need to return data in sorted
order, you can use the .sort() method (http://www.mongodb.org/display/
DOCS/Querying#Querying-Sorting)

Using a redis cache may not be necessary, especially if it makes it
harder to sort.

Finally, my understanding is that jqGrid will do sorting on client
side. If you instantiate the grid with a tremendous amount of data,
sorting will be slow. Generally, you can use a timestamp (or _id,
which contains a timestamp) to limit the data included in the report
to a managable quantity of recent data.

Can you perhaps rephrase the question (if the above is off track)?
Thanks!
 - Brandon

On May 3, 3:58 pm, danpolites <dpoli...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »