Why use ORM in PHP?

Recently I started to study ORM, the question jumped up in my opinion:

MySql and Sqlite are used mainly in PHP applications, almost all PHP servers are set up like this, so is it worth using ORM in PHP to be database independent?

What about performance?

+5
source share
6 answers

Database independence is not the main reason for using ORM. what you want to have is a general database abstraction. this may mean: ease of use, faster development, database independence, ... in any case, it is usually worth using ORM. if your application absorbs all your processor power, you can use some simple sql to optimize certain queries. I guess this is a rare case.

You can read the following: What are the benefits of using ORM?

+5
source

There are several reasons you can use ORM, which I can think of:

  • Most ORMs allow you to validate data for INSERT and UPDATE.
  • ORM db db. , , - , .
  • . (, , 1: m , ).

/ .

, php , .

+4

( ) PDO. , SQL-.

O/RM, OO-flair... . PDOStatement:: fetch ( fetchXxx).

+3

, PostgreSql SQL Server - .

, ?

, - , ? , , mysql_query.

... . .NET, , , , .

ORM - . , , , .

+1

ORM , , , , , - , , .

, , , , . ORM , .

, ORM .

, .

+1

ORM - . , , :), . ORM , . 2 :

  • ( ), ..,
  • , . , .

    • , ORM, , , , , - ORM:)
    • ORM, " " , ORM . , ORM , ORM ( ) 10 ( , )? , . , - NOSQL.

In my opinion, ORM is only alive thanks to the framework that uses it internally. And performance? I'm not sure (since I don't use it anymore), but I believe that performance can be a problem too. Do you have to pay at least some price for correctly rejecting the database query? I think ORM was a great idea on paper, but it just doesn't work well.

+1
source

All Articles