I posted a question a while back on SO but didn't get a huge response and I was wondering what the general opinion would be.
I want to use a database to server data for multiple customers but am considering a number of different ways to segregate the data.
Here's the original question...
My question is what is the most effective way to model a database (or database) for multiple clients.
Given how easily new databases can be created and used I was thinking that it may be good to use separate databases per client to isolate the data.
Then I read several questions like this asked already and from what I can see the general consensus is that there will be physical limits on the OS/File handles - so the preferred approach would be to use a single database with multiple collections.
Would it therefore be best to create a collection of each type for each customer, e.g. db.mycollection_cust1234 or to hold a reference to a customer doc in each collection and create a compound index on ClientId and the _id?
Any advice / experience welcome.
EDIT: in response to dubs' comment, would it therefore best to have to have:
// Equipment collection with CustomerId
{ EquipDesc = 'Hammer', CustomerId = ObjectId(xyz) }
// or Equipment_xyz (and one for each customer)
db.Equipment_xyz.insert( { EquipDesc : 'Hammer' } );
Thanks in advance,
Sam
Hopefully it's clear from the original question what I'm trying to do.
Thanks in advance
Sam
Sam
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb