If I use an ORM let's say with Zend or Symfony. Is it an all or nothing deal?
I'd like to use the ORM, but also want to optimize performance in some cases and write the query myself to get to the nitty gritty. So if I start using an ORM, is it going to be difficult to do it the old way once I include it in my project?
Using an ORM does not mean that you do not have to care anymore about how the application interacts with the database so you can treat it as a neglectable piece in your architecture. On the contrary, you just added another layer of abstraction and complexity, the ORM itself.
NotORM is a PHP library for simple working with data in the database. The most interesting feature is a very easy work with table relationships. The overall performance is also very important and NotORM can actually run faster than a native driver. NotORM for databases is like SimpleXML for XML documents.
What is an ORM? An object-relational mapper provides an object-oriented layer between relational databases and object-oriented programming languages without having to write SQL queries. It standardizes interfaces reducing boilerplate and speeding development time.
When it comes to hands-on management, SQL is higher than ORM. It is because of the human expertise involved in running queries in data management and retrieval. It is important to know how to use SQL in order to maximize the benefits and performance of the database.
Most ORMs will let you run adhoc queries.
Using Doctrine it is fairly easy to "break out" of the ORM. Doctrine lets you write queries in 4 different ways:
If you're using Doctrine inside of Symfony, there are absolutely no features of Symfony that lock you into using Doctrine, even if it's enabled.
One final warning: if you're using some of Doctrine's advanced features (e.g. events or behaviors) these will become difficult to tie in when you do queries outside of DQL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With