best method Implements followers with meteor/mongodb -


i'm doing app users can follow topics. best schema implement mongodb , meteor?

i thought 2 solutions:

first 1 collection:

schemas.follow = new simpleschema({ userid: { type: string } topicid: { type: string } } 

pro: no problems document 16mb limit cons: performances search slow (?)

second use ids array in users , topics collection

schemas.user = new simpleschema({ ... follows: { type: [string] } }  schemas.topic = new simpleschema({ ... followedby: { type: [string] } } 

pro: better performance of search cons: problem of 16mb limit per document

have better solution mongodb , meteor?

thanks!

a mongodb objectid 12 byte object repesented string of 24 characters. if assume large storage overhead (say, 100 bytes per id), 16 megabyte document can store on hundred thousand ids.

assuming users humans, , follow topics manually, it's safe store topic ids in array.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -