title: Best Practices: Tracking Banner Impressions
body: <p>I am writing a banner ad engine in php/mysql. I don't want to use OpenX or a turn-key solution because there is going to be a bunch of custom functionality that I would rather not rely upon an existing system to have to flex to accommodate.</p>
  
  <p>Here is the thinking and my current approaches to the impressions architecture:</p>
  
  <ul>
  <li>Requests to banner server come in via javascript snippet on target site</li>
  <li>Server has cached list of banners to serve and returns appropriate image as needed.</li>
  <li>Impressions are recorded to log files similar to apache's access log style: using a rotating text file, adding one line per impression.</li>
  <li>Log files record user IP, url, banner id, time, etc.</li>
  <li>Log files are rotated hourly and are then summarized (also hourly) to a mysql DB so advertisers can get (close to) real-time stats on activity</li>
  </ul>
  
  <p>My concerns are:</p>
  
  <ul>
  <li>Is writing to a "log" file an efficient and scalable way to record the impressions? We expect to serve 13-15 million impressions a month.</li>
  <li>Any pitfalls with the log writing approach?</li>
  </ul>