Re:Has anyone ever used an ORM and at some point just "swapp...
by bflbfl on Friday April 12, 2013 @02:43PM
(#5540313)
to try to be a little clearer - I meant swap amongst MySql/Oracle/SQLServer/whatever. It seems that this was (still is?) one of the purported advantages of an ORM in general, and I was just curious how often it really even comes into play.
[ Parent
| on HN ]
Re:Has anyone ever used an ORM and at some point just "swapp...
by sherril8 on Friday April 12, 2013 @03:33PM
(#5540550)
The benefit of using an ORM is that if you did want to change the type of database, most of your code would be able to go unchanged (theoretically). If you did switch, you should be able to just change a config file to let the ORM know which database you are now using. The ORM will then run the correct underlying queries.
This usually comes with a hit to performance though. Raw queries are generally quite a bit faster. So if you dont plan on changing databases on a project, it might be beneficial to skip the ORM where possible.
The ORM also doesnt help you with migrating the records from one database type to another. So if you already have established records that is a separate issue.
Re:Has anyone ever used an ORM and at some point just "swapp...
by jeff303 on Friday April 12, 2013 @04:59PM
(#5540956)
I've "swapped" H2 and Sybase in a Java/JPA/Hibernate project. I use quotes because H2 was an in-memory DB for the unit tests, but it has the same table structure in both cases. And it wasn't really swapped so much as built at the same time, but the same code did work on both.