In the past few years ORMs have become increasingly popular; however I, personally, don’t like most of the ORM libraries.

ORMs are used to map data from the database to access it easily, and generally they do make it easier than regular SQL.
Nevertheless, these libraries are usually very heavy (Doctrine is almost 2MB!) and they enforce you to learn their complex usage (take a look at Doctrine’s documentation).

In contrast there is NotORM written by Jakub Vrána, which is a library for manipulating databases.
It is very easy to learn, you don’t have to create a class for every table in your database, and it handles table’s relationships sometimes faster than native PDO!
I won’t explain in this quick tip about NotORM, but you can read more about it in NotORM’s website.

Tagged with:
 

2 Responses to Tip, use NotORM

  1. Dmytro Vasylenko says:

    Hi, how it can be faster then PDO if it uses it for access DB? May you wanted to say it requires less lines of code for certain operations?

  2. Jakub Vrana says:

    NotORM transfers only the data that are really used. So instead of executing SELECT *, NotORM executes only e.g. SELECT id, name. Another reason is that NotORM doesn’t use joins so no data (except primary keys) are transfered repetitively. Take a look at http://www.notorm.com/static/doctrine2-notorm/ for further explanation.

    It is of course possible to write native PDO queries that performs same as NotORM but it is usually much harder and sometimes counter-intuitive.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.