Re:The growing irrelevance of MongoDB
by xerophyte12932 on Wednesday January 14, 2015 @07:56AM
(#8885900)
I would probably solve this problem using Relational DB by having an ItemHeader table with all the common attributes. Then will make an ItemAttributes table where I'd use the foreign key of the first table and just have Key/value pairs for all the unique attributes you want to give to the item. Any sort of query on any of the attributes can be one via a simple join.
Though i suppose it gets trickier if attributes may have sub attributes etc....
Re:The growing irrelevance of MongoDB
by icebraining on Wednesday January 14, 2015 @07:19AM
(#8885754)
In a sql db, every single thing needs to fit into a flat schema with nesting done by relations.
Nope, see Postgres (hstore and json).
why not "see sql server from 10 years ago with xml column type"?
Re:The growing irrelevance of MongoDB
by icebraining on Wednesday January 14, 2015 @08:38AM
(#8886099)
Because one example is enough to dispel that myth, and I'm familiar with Postgres, and not with "sql server from 10 years ago with xml column type".
Are you saying you're using a single MongoDB collection as a dumping ground for all your entities? I hope you're not building a real product that someone has to maintain.
I don't actually use Mongo at all, I prefer Postgres. But for loosely structured data, it has a use case. Just like dynamic vs typed languages, there are pros and cons.
Agreed. That said, optional schema enforcement would be really nice (in my experience, most of the data has a predefined format; so why not define schema and enforce it?).
In a sql db, every single thing needs to fit into a flat schema with nesting done by relations. Additionally, it's very rigid. Maybe you just don't want to set up a laces table, and 4000 other tables for every little attribute of every product. Of course this is not how you would do it in real life, there are better ways. Mongo is one of those ways.
Saying that Mongo is good for nothing is just as dumb as saying that Mongo is good for everything. In 2015, the Mongo backlash is just as tired as the Mongo hype.