Note that there are some explanatory texts on larger screens.

plurals
  1. POIs MongoDB the right DB for a community site?
    primarykey
    data
    text
    <p>I'm creating a community site with Node.JS and Express and almost all express tutorials or examples use MongoDB, so I checked it out. The only DB I used so far is MySQL but I'm not that much familiar with it so it wouldn't bother me to read into MongoDB. Mongo looks quite nice and the document model might be beneficial. And with mongoose it's easy to use. But I got some questions so I don't spend a lot of time learning to use MongoDB if it doesn't fit at all:</p> <ol> <li><p>I've read that MongoDB is unreliable if you use it on only one machine and you might encounter data loss. Is that right? The project is not that big that I could afford another server and data loss is totally a no go! Imagine some forum posts just disappear. But I guess people wouldn't use it if that happens.</p></li> <li><p>The site will contain a self-build forum and I'm not sure if a relational db would be better. However you could save threads with embedded posts and so on. But no idea how to search as Mongo doesn't support full text search. What do you think?</p></li> <li><p>When to use embedded documents in Mongo? Example: A user can post status updates like on Twitter. Would you save these updates in the user document? Can be a lot of updates. Or a document per update and link it to the user id? 3.1 And how to query across multiple documents? You want to fetch the last 10 status updates of your friends. You can do that with JOINs in MySQL.</p></li> <li><p>Is there a way to use auto-incremental IDs for documents like in MySQL? A user for example should have a unique integer key but I don't want some random number like Mongo does it, in order keep the user IDs small.</p></li> <li><p>How do you handle race condition in mongoose? You load a document from db, edit something and save it later. But maybe it has already changed in the mean time.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload