News for hackers. Stuff that matters.
Re:The Marketing Behind MongoDB by twic on Tuesday August 29, 2017 @04:52PM (#15127509)
If you're using an ORM, you can generate the schema automatically. With Hibernate, you set the hibernate.hbm2ddl.auto property [1]. If you set it to 'create' or 'update', it will alter the database schema so that it matches your objects, which is handy for prototyping, and terrible for production. If you set it to 'validate', it will check that the database schema matches your objects, and refuse to start if it doesn't, useless for prototyping but ideal for production.

[1] https://stackoverflow.com/questions/438146/hibernate-hbm2ddl...

Re:The Marketing Behind MongoDB by lewisl9029 on Tuesday August 29, 2017 @09:04PM (#15128933)
That's a neat feature, but as you may already know, ORMs come with their own baggage in the form of object-relational impedance mismatch. There's an entire rather-substantial Wikipedia article on it, so I won't go into it any further myself: https://en.wikipedia.org/wiki/Object-relational_impedance_mi...

The sibling thread also brings up similar issues with ORMs: https://news.ycombinator.com/item?id=15127058

Re:The Marketing Behind MongoDB by aryehof on Friday September 01, 2017 @09:32AM (#15148171)
ORMs are a solution to the problem of the impedance mismatch between an object model and its corresponding relational model. It's not that ORMs come with the problem.

I think it increasingly rare today to see real object domain models anyway - the original raison d'etre of ORMs. Instead it's common to see domain concepts modeled in the data layer and modified by logic (often limited to CRUD) in an application/service/controller layer. The problem with this of course is that as complexity increases, that app/service/controller layer increasingly approaches a big ball of mud.

Edit: grammar

Re:The Marketing Behind MongoDB by twic on Wednesday August 30, 2017 @04:44PM (#15135837)
Eh. I've used ORMs and SQL extensively for many years. I think the concerns over mismatch are routinely overstated.