Profiling symfony with CouchDB
on February 20, 2009During the last two sprints we run in the need to perform statistic analysis to profile a symfony application. As I explained here symfony logs to the file system quite a lot of useful information regarding the request that is processing. We wanted to be able to easily parse those logs and then perform queries to filter data. The data was going to be collected form our productions servers, which means that whatever tool we choose must not impact the performance of the website. We knew that symfony logs to the filesystem which was not an option for our production servers.
Our first attempt was to research Facebook Hive and Facebook Scribe, but we declined the idea. We then thought that we could try to build our own tool, probably writing some daemon in Erlang, but something appeared in our way…
During the research regarding map reduce Wikipedia led me to the mighty CouchDB, which in their words is:
Apache CouchDB is a distributed, fault-tolerant and schema-free document-oriented database accessible via a RESTful HTTP/JSON API. Among other features, it provides robust, incremental replication with bi-directional conflict detection and resolution, and is queryable and indexable using a table-oriented view engine with JavaScript acting as the default view definition language.
I must say this: after seeing some examples about it’s functionality my mind blew off. It was awesome, awesome like in CouchDB :-)
Then the idea popped in my mind:
Why not to build a symfony logger that talks to CouchDB and create some CouchDB views that will produce the statistics? I was at home and It was late at night, but my inner geek told me: let’s give it a try.





