Of course I have a backup!

Random blobs of wisdom about software engineering

Archive About Me Consulting My toolset

I have been using Doctrine2 for about 3 years now. I started with the first 2.0 stable, integrating it into my employer's in-house framework, and in the last year, I have been using it as part of Symfony2. There are quite a few things that I love about it, and a small amount that I dislike.

Continue reading ...

When using Doctrine, it very frequently happens that you have an entity in hand, an Article for example, that is in a many-to-one relationship with another entity (a Category), and you need to get the related entity's id. The problem is that Doctrine uses proxy objects for relationships, and when you access the id, the proxy will self-load itself, sending a query to the database. Shouldn't it be possible to get the related id, without another query? It's in the same table after all.

Continue reading ...

This a response to Mattis Geniar's post, titled Bad ORM is infinitely worse than bad SQL, where he talks about his bad encounters with ORMs, and how easy it is to mess up performance, and forget about what really happens behind the scenes. He ends the post with

If you disagree with me, prove me wrong.

Be my guest.

Continue reading ...

Doctrine2 is an ORM (Object relational mapper) library for PHP, and is one of the best things to happen to the PHP world, so far. The main point of an ORM is, to put it simply, to allow you to map PHP objects, to database tables. You can save and load your objects to/from the database, in a general way, that is, you don't need to write select/insert/update/delete SQL queries for them, because the ORM will take care of that for you.

Continue reading ...

We had a site that was expecting 100k+ unique visitors, but only for a single day. The motto of the site is "the day of internet shopping", basically, it is centered around having larger stores of all kinds, signing up, and making discounts, that are only valid for that single day only. I want to show some steps that we took to make sure that the website does not crash under the load.

Continue reading ...