27

What's everyone's thoughts on MongoDb. Should I learn it? What's some good use cases?

Comments
  • 14
    I decided to use it (because shiny new thing), then wished I'd stuck with a relational database

    On one hand it's nice that everything is Javascript/JSON (since I'm using a Node backend), but on the other hand I feel like there's about 10x more code than there should be

    Although I am using Mongoose for...actually I'm not entirely sure what it's for - it was in most tutorials so I just ran with it. But anyway, that may be the source of my woes, not Mongo itself

    In conclusion, I have literally zero freaking idea
  • 6
    I feel like it's good to have at least *some* knowledge on both styles of DB, so you can adapt quicker to any enforced constraints
  • 7
    @Ezard Mongoose is an ODM (Object Document Model) for MongoDB, basically, it adds some structure to.your documents and makes it easier to query and work with your data (in most cases).

    Anybody smarter than me care to elaborate some more?
  • 2
    @AllenII Thanks for clarifying :)
  • 4
    I like mongo db it's cool haven't really used it in a project yet but I am planning to pretty soon I suggest you register for their free course and check it out

    https://university.mongodb.com/cour...
  • 1
    Mongo db is a document store. It can store jsons. I use it in my application for storing user profile or user details. Queries are also built as json only. Great with node js. Faster.
  • 7
    If you never used a nosql database, then you can play with mongodb so you know what to expect in the future. Then you will realise how good were the relational databases and will return back to them.
  • 2
    I have used Mongo for a big project, and learnt MySQL and Oracle throughout college and university.

    Mongo provides a lot of flexibility and power. It is faster in many cases. Using redundancy with embedded documents solves a lot of issues.

    referential integrity is really nice, but the flexibility it has afforded me in this projects have been a big win.
  • 6
    Definitely worth trying out. The way you'll organize your database will be completely different from how you'd organize it with a relational database. There are some use cases where it makes a lot of sense. And it's nice to get a chance to figure this out yourself as you go as you try it out. Then, in the future, you'll have a good idea of if a project you're about to start makes sense to be a NoSQL or SQL design.

    Also worth mentioning is that a lot of relational databases like MySQL and PostgreSQL have support for NoSQL features, usually with a JSON column data type and a set of operators for getting at the properties of it.
  • 1
    @welkie I think one SHOULD organise their database differently.

    Welcome to devRant
  • 1
    Also Mongo + GraphQL is the best of both worlds
  • 1
    @gofrendi, it is so good, like rest on steroids
  • 1
    I'm about to use it for a fairly simple side project that I'm doing just to try a new stack out (vue or react frontend, node backend and mongo database), from what I've seen so far mongoDb looks good! But I guess I'll find out when I'm done!
  • 0
    Meanwhile there is Meteor JS. Where MongoDB is used as if it's a relational database. The fault is really in the DDP, but still: don't fucking use the shiny new thing just because it's shiny and new and open source projects use it...
  • 1
    @armeg actually it's BSON 😇
  • 0
    @balte MongoDB is used pretty extensively in industry
  • 1
    @Hedgepig mongodb was three years old when MeteorJS was initially released though.
  • 0
    "Should I learn it?"
    NO. RUN AWAY AS FAR AS U CAN.
  • 1
    @balte ah right, yeah. Also not sure what you mean by it bring used as a relational db
  • 0
    @Hedgepig as in: everything being a single level object because their data sync protocol can't deal with multilayered objects. so you still need to manually join "tables" (more like documents, or objects of a certain type in this case).
  • 0
    Yeah, same issue normally with Mongo right? The Meteor project I'm currently doing uses Apollo/GraphQL so that by passes the ddp, except where we use Meteor methods
  • 0
    To my understanding: Mongo doesn't really care about how much layers your document's object has.
    That's the beauty of nosql, right? you can build these huge objects inside your database and filter them down when you send data to the client.
  • 1
    But, to be fair. I rarely use mongo these days. I find that the projects I do don't need to scale to that extend and setting up NeDB is waaaaay easier :D
Add Comment