We need to insert records in mysql quite fast for the purpose of syncing it with an other database.
Which performs faster inserts. PHP PDO or some ORM (propel/doctrine)
We need to insert records in mysql quite fast for the purpose of syncing it with an other database.
Which performs faster inserts. PHP PDO or some ORM (propel/doctrine)
Think about it for a second.
An ORM will involve creating entities and then the code will look at the mappings to figure out how to change that into SQL, etc.
Using PDO is just straight SQL statements. You give it a string of SQL and it'll run that.
PDO wins.
ORM provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data.
PDO does not provide a database abstraction. which means it does rewrite SQL or emulate missing features.
You should use a Data abstraction layer if you need that facility. ORM gives that facility.
Note: when performance is the only criterion it's better to use raw SQL queries as more abstraction will relatively slower the app still it's negligible to differentiate but when we expect database abstraction in our application it's better to use ORM.