Live data from Hacker News

Ask HN: Why use MongoDB?

news.ycombinator.com

1–10 of 17 posts

Ask HN: Why use MongoDB?

#1
I have given three chances to mongodb. Not fill my expectations, in the end for me there will be a need for a join or complex queries. I have tried to use it in 4 projects and does not convince me. Can anyone give me a reason other than replication to use it

Re: Ask HN: Why use MongoDB?

#2
What language are you writing your project(s) in?

If you are using Node you should use Mongoose and then you may see why some people love Mongo. Complex queries and joins (not technically called joins I guess) are incredibly easy to accomplish with that module[1]. Personally, I have migrated back to MySQL since I was unable to convince my colleagues that Mongo would last long-term and frankly I am not 100% confident either for the kind of business applications that we need[2].

[1]: http://mongoosejs.com/docs/populate.html

[2]: payment processing industry handling billions of records

Re: Ask HN: Why use MongoDB?

#3
I've found it useful in storing and querying JSON documents. Basically, scraping an API (for me it was an OpenTripPlanner instance I had set up) and then being able to query any property in the data very easily.

But I didn't use joins, nor was this anywhere near a production server. From my understanding, if you have a heavy requirement for joins then you just shouldn't be using MongoDB in the first place. It isn't a traditional relational database.

Re: Ask HN: Why use MongoDB?

#4
post #2

What language are you writing your project(s) in? If you are using Node you should use Mongoose and then you may see why some people love Mongo. Complex queries and joins (not technically called joins I guess) are incredibly easy to accomplish with that module[1]. Personally, I have migrated back to MySQL since I was unable to convince my colleagues that Mongo would last long-term and frankly I am not 100% confident…

I used java, node and .net, this question it's because i love mongodb,I like mongodb and many of its features but I have not found a use for my projects and so far I'm only seeing mongodb for small projects or simple queries. I have not used mongoose because i do not like ORM, but I'll do some testing on it

Re: Ask HN: Why use MongoDB?

#5
post #3

I've found it useful in storing and querying JSON documents. Basically, scraping an API (for me it was an OpenTripPlanner instance I had set up) and then being able to query any property in the data very easily. But I didn't use joins, nor was this anywhere near a production server. From my understanding, if you have a heavy requirement for joins then you just shouldn't be using MongoDB in the first place. It isn't a…

I have come to the same conclusions, for that reason I asked this question, one of the reasons that i like mongodb is that data is in JSON

Re: Ask HN: Why use MongoDB?

#6
post #4
post #2

What language are you writing your project(s) in? If you are using Node you should use Mongoose and then you may see why some people love Mongo. Complex queries and joins (not technically called joins I guess) are incredibly easy to accomplish with that module[1]. Personally, I have migrated back to MySQL since I was unable to convince my colleagues that Mongo would last long-term and frankly I am not 100% confident…

I used java, node and .net, this question it's because i love mongodb,I like mongodb and many of its features but I have not found a use for my projects and so far I'm only seeing mongodb for small projects or simple queries. I have not used mongoose because i do not like ORM, but I'll do some testing on it

I would strongly recommend it.

My experience with ORMs has not been pleasant either but Mongoose was very, very nice.

Re: Ask HN: Why use MongoDB?

#8

You should use the DB you need. Sometimes SQL is best, sometimes nosql. For me, the prime reason to use mongo is if I have data that I cannot structure before hand.

I'd also argue that being able to be more adaptive with how data is structured can be good for a project where things change very quickly. If you have something where the data model is of simple to moderate complexity and persistence is required, the smaller overhead of changing things on mongo vs having to update a SQL schema can be worthwhile. (For reference my specific use case was using rails with activerecord vs mongoid here).

Re: Ask HN: Why use MongoDB?

#9

You should use the DB you need. Sometimes SQL is best, sometimes nosql. For me, the prime reason to use mongo is if I have data that I cannot structure before hand.

Same here one of the reason i like mongodb and other NoSQL it's the schemaless approach

Re: Ask HN: Why use MongoDB?

#10
post #2

What language are you writing your project(s) in? If you are using Node you should use Mongoose and then you may see why some people love Mongo. Complex queries and joins (not technically called joins I guess) are incredibly easy to accomplish with that module[1]. Personally, I have migrated back to MySQL since I was unable to convince my colleagues that Mongo would last long-term and frankly I am not 100% confident…

What would be your plan for ensuring referential integrity when working with MongoDB?
Post reply on HN