Home  >  Article  >  Database  >  What are the disadvantages of Object Relational Mapping ORM?

What are the disadvantages of Object Relational Mapping ORM?

coldplay.xixi
coldplay.xixiOriginal
2020-07-01 10:24:573366browse

The disadvantages of object-relational mapping ORM are: 1. Low execution efficiency. Automatic mapping of relational databases requires system performance; 2. Not flexible enough. For complex queries, ORM cannot handle complex queries; 3. It is very likely that Extracting all data into memory objects and persisting all attributes will consume more memory space.

What are the disadvantages of Object Relational Mapping ORM?

Object Relational Mapping (Object Relational Mapping, ORM) is a programming technology used to implement different object-oriented programming languages. Conversion between type system data.

Specifically, the mapping between objects in object-oriented language programs and data in relational databases is achieved by using metadata that describes the mapping between objects and databases. In effect, it actually creates a "virtual object database" that can be used in programming languages. It generally exists in the form of middleware.

ORM is based on three core principles:

  • Simplicity: Model data in its most basic form. (A persistent class corresponds to a table, each instance of the class corresponds to a record in the table, and each attribute of the class corresponds to each field of the table.)

  • Conveyability: database The structure is documented in a language that anyone can understand.

  • Accuracy: Create correctly standardized structures based on the data model.

ORM also has shortcomings, which are as follows:

1. Low execution efficiency. Automating relational database mapping requires system performance; the execution efficiency is lower than directly written SQL statements.

2. It is not flexible enough. For complex queries, ORM is unable to cope with it.

3. It is very possible to extract all data into memory objects and persist all attributes, which will consume more memory space.

Related learning recommendations: mysql video tutorial

The above is the detailed content of What are the disadvantages of Object Relational Mapping ORM?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn