Archive for the ‘PHP’ Category

Multiple row operations in MySQL / PHP

Thursday, May 14th, 2009

Multiple row operations are in common use in a normalized application databases as one database entity is often linked to multiple sub-entities (for example a user and his tags). By row operations I'm referring to write queries, namely UPDATE and INSERT queries (DELETE is less interesting so I'll leave it out for now).

Too often I've seen such queries ran in long loops one at a time, which is very bad for performance (as I will show here) and sometimes equally bad for integrity (if the process is interrupted). So what are the alternatives?
(more...)

Zend Framework certification

Tuesday, December 30th, 2008

Today I took and passed the Zend Framework certification exam. A possible project involving Zend might be materializing in the near future, and this was a requirement from one of my contractors (OpenIT). Being that they offered to sponsor the cost, I had no reason not take it.

As I found no concrete online information on the test (and the guide link from Zend doesn't work), I might as well elaborate a little for the benefit of future test takers reading this blog -
(more...)

OO PHP templating

Tuesday, November 18th, 2008

Templating is a common technique for separation of concerns in applications - separating presentational logic from domain (or business) logic. This kind of separation promotes higher maintainability and a better chance to reuse presentational code (by encapsulating it in templates), the kind of traits we would all love to have in our code base.
(more...)

Making web-pages go faster using PHP

Sunday, November 16th, 2008

UI responsiveness is one of the basics of a good user experience. In the web environment, this often translates to the loading time of pages.

As it might be expected, there are several techniques to optimize the delivery of web pages. The Exceptional Performance guide by Yahoo is a great resource for a multitude of optimizations practices, including specifically two techniques which I will address in this article - script minifcation and concatenation.
(more...)

Profiling queries with Zend_Db and optimizing them by hand

Sunday, October 12th, 2008

Database performance is one of the major bottlenecks for most web applications. Most web developers are not database experts (and I'm no exception), there are however several basic methods to analyze and optimize database performance without resorting to expert consultants (such as those, whose founders blogs are an invaluable source of MySQL knowledge).
(more...)