I finally found the original thread :
http://groups.google.com/group/mongodb-user/browse_thread/thread/87baaf84bec3f20b/1663a6e8cbb34111?lnk=gst&q=collection+database#1663a6e8cbb34111
I guessed that having one collection per user (yes, user of the
application) could be a good idea. So we can manage data per user more
easily : import/export, data migration . It would also be useful if a
repair could be applied to single collections.
Possible corruption would not impact every users.
Having a lot of collections means less data to retrieve for each
query, less data and/or indexes to scan.
Migrating users to new features can be done progressively by migrating
data one user after another.
It also allows to add indexes at runtime for a specific user once he
logs in, instead of adding index for all the data we have at once. It
would mean that users that do not come back don't waste time, CPU and
disk space for new indexes.
Also, I don't totally understand the upcoming sharding feature. Is it
made only to shard one big collection ?
From
http://www.mongodb.org/display/DOCS/Sharding+Design: "A chunk can
be though of as (collectionname,fieldname,lowvalue,highvalue"
In this case my "one collection per user" setup would not work :)
Why do you think that's not a good idea ? I thought it was easier to
scale when you have the chance to be able to split up data in multiple
as little collections/tables as possible. In our case, users do not
share data with each other, and they can easily have a collection of
several hundred of megabytes.
On Aug 11, 2:29 pm, Eliot Horowitz <
eliothorow...@gmail.com> wrote:
> Where did you see a recommendation of 1 collection per user? I don't
> think thats a good idea. Assuming you mean user of your wesbite or
> something like that.
>
>
>
> On Tue, Aug 11, 2009 at 5:43 AM, Nicolas Fouché<
nicolas.fou...@gmail.com> wrote:
>
> > In another thread, I read that it's a good idea to make as much as
> > collection as possible instead of putting all data in one single
> > collection. For example, making one collection per user. But if you
> > have let's say 10 indexes per collection (+ the _id), you'll be able
> > to create: 12,000 / 10 = 1,200 collections ?
>
> > The documentation says that setting a big limit in the MongoDB code
> > should work fine.
http://www.mongodb.org/display/DOCS/Using+a+Large+Number+of+Collections