3 ms·
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
by sherril8 13y ago
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.