language agnostic - Using an ORM or plain SQL? -


For some apps I developed (then left to forget about it), I'm mainly writing plain SQL MySQL For though I have used ORM in Python, I have not been with them for a long time. Usually this either holds a copy of the documentation or complexity (from my viewpoint).

I see it like this: Use an ORM for portability, plain SQL, if it's just a type of database to use. I'm really looking for a consultation when to use ARM or SQL during the development of an ARM.

While thinking about it, it would be better to use light casing to handle database incompatibilities, using ORM vs.

ORM has some good features that make the copy of the database column to object that field Can handle dog work They usually handle changing language type and time type for the appropriate database type. They usually handle Nested Objects in a beautiful manner with one-to-many relationships. I have found that if you design your database with the strengths and weaknesses of ORM, it saves a lot of work in getting the data in the database and getting out. I would like to know if you want to map them For polymorphism and multiple-to-many relationships, these two domains provide the most of the 'impedance mismatch', which is 'column'.)

For transactions with transactions, Or You make a request, get some objects, transmit them to get some data and render on a web page, display is smaller, and in many cases the ORM can be faster because it Cache items that are seen before, otherwise the database should have multiple inquiries.

For those applications that are heavily reporting, or to handle large number of database rows as requested, the ORM tax is very heavy, and what caching is a large, useless memory-hogging burden Turns into In that case, there is a way to go hand-coded SQL queries in simple SQL mapping (LinQ or iBatis) or thin DAL.

I have found for any large-scale application that you will find yourself using both approaches (direct CRUD for reporting and ORM for SQL / thin DAL).


Comments