I use mongodb as a database repository.
my web application should collect user responses.
user response is a document in mongodb (or a string in sql). document length is about 10 ~ 200.
user responses are classified (only for one category). for each category, the number of user responses ranges from 100 to 5000. if two documents are in the same category, they have the same length. (or they have the same columns in sql)
a category can be dynamically created / deleted at the request of administrators.
currently my data structure
category collection {_id, 'name' : 'c1', 'somevalue' : '123'} {_id, 'name' : 'c2', 'somevalue' : '23'} {_id, 'name' : 'c3', 'somevalue' : '143'} {_id, 'name' : 'c4', 'somevalue' : '153'} ... 'c1' collection { userresponse1 } { userresponse2 } { userresponse3 } ... 'c2' collection { userresponse1 } { userresponse2 } { userresponse3 } ... 'c3' collection { userresponse1 } { userresponse2 } { userresponse3 } ... 'cN' collection { userresponse1 } { userresponse2 } { userresponse3 } ..
Is this a wise decision? I worry about the possibility of something bad, assigning a collection to each category. Will there be some performance issues if I have many collections? Should I combine my collections and give userresponses some identifiers instead?
thkang
source share