Re:Learning Go as a Node.js Developer
by marcus_holmes on Friday February 09, 2018 @07:18AM
(#16339638)
I think it's more 99% of databases are warped horribly to pretend that objects map to tables.
If you throw away the concept that anything in your database has to map to anything in your code base, then you design better databases. Different databases, more to the point.
Re:Learning Go as a Node.js Developer
by manigandham on Friday February 09, 2018 @12:51PM
(#16342274)
Oh ok, so your code just doesn't deal with data in the database then? I dont understand what point you're trying to make here.
You can lay out your tables however you want, and you can then map them to objects using an ORM. That's what mapping means, to translate from domain to another. There's no limit on how things are actually designed and ORMs usually do a much better job of handling all that bulk code for you. Nothing is stop you from writing SQL yourself if you really need something complex but again, you should know when and where that is.
As mentioned, if you're in the 1% scenario where this approach doesn't work then you already know you should be using something else. Not knowing when to use what is a far bigger issue than any problem an ORM can cause.