Skip to content
  • 0 Votes
    3 Posts
    998 Views
    NoduleJSN
    Thank you for the explanation. I will probably use a third-party database (firebase) for payments. Using firebase, different operations can be done on the client side, without disturbing the main server. I think this is very useful for a smoother user experience.
  • One collection vs several collections

    General Discussion
    8
    0 Votes
    8 Posts
    6k Views
    barisB
    If you are only going to use mongodb definitely have multiple collections with indices that make sense. For example your users collection can have indices on username whereas your posts collection can have indices on content and userid etc. Well, remember that NodeBB is firstly designed with redis in mind (a simple in-memory key/value store) so that might affect the document design decisions they made for their mongodb collection. This is why we have one collection in our mongodb implementation. To make db.delete db.rename easy to implement. From the db perspective there is no difference between a post and user object they are both indexed by the _key field so finding them is easy. For sorting and querying we use sorted sets, they are implemented in mongo using indices on value and score. if embedded documents in my collection persons is more efficient than saving them in the same collection with a different key. I wouldn't suggest embedding lots of documents, mongodb has a document size limit of 16mb so it won't let you insert more users after some point.
  • mongodb single collection?

    General Discussion
    3
    1 Votes
    3 Posts
    4k Views
    julianJ
    In a nutshell, because database abstraction layers make compromises...