GSoC/GCI Archive
Google Summer of Code 2009 The Linux Foundation

OpenPrinting: Making the web-based application for browsing the database less resource consuming using a PHP/MySQL architecture

by Subhankar Sett for The Linux Foundation

OpenPrinting provides and manages the Foomatic Database which is a central store for printer drivers and is available under the /usr/share/foomatic directory. The current website of OpenPrinting is completely designed based on CGI scripts written in Perl and the various printer & driver configurations are stored in the Foomatic XML format maintained using a BZR VCS on the server. The server faces a lot of hits everyday as people search for the best driver for their printer and this causes a huge overload as CGI processes are created and executed per request generated. The idea is to completely change the architecture of the web-service by layering off things into presentation, service and database levels. The MySQL DB handles all the metadata for each of the printer and driver entries while the service layer polls and inserts data from the DB or from memcached which is an object caching system ( The web page presentation is maintained using smarty templates ( and javascript. Authentication is setup using LDAP to customize access to different parts of the website. Perl and PHP CLI are used to create cron jobs that automate the build of the printer XML DB.