Return-Path: X-Original-To: apmail-mahout-user-archive@www.apache.org Delivered-To: apmail-mahout-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDE6B10FD3 for ; Wed, 5 Jun 2013 11:45:26 +0000 (UTC) Received: (qmail 74689 invoked by uid 500); 5 Jun 2013 11:45:24 -0000 Delivered-To: apmail-mahout-user-archive@mahout.apache.org Received: (qmail 74666 invoked by uid 500); 5 Jun 2013 11:45:24 -0000 Mailing-List: contact user-help@mahout.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@mahout.apache.org Delivered-To: mailing list user@mahout.apache.org Received: (qmail 74441 invoked by uid 99); 5 Jun 2013 11:45:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 11:45:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lianshiwu@gmail.com designates 209.85.212.195 as permitted sender) Received: from [209.85.212.195] (HELO mail-wi0-f195.google.com) (209.85.212.195) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 11:45:18 +0000 Received: by mail-wi0-f195.google.com with SMTP id hm9so357099wib.2 for ; Wed, 05 Jun 2013 04:44:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ouENJZEu5wejs28ejqIzuKpD6ZZySsSFVbRiI/4DpRI=; b=F820XBBOZZ7NLR+NluGBDxk/nOKXWU6xMrzutp36OLAhW64m5BQfy/vIqnOHrgQbOD NqRrGxOtHRpFIIvlRmeLLwJw34cZTt/+IavvCcSCLSOorqx/st3eh9rB29ozF7tRammx BU2JWXsmOY2zwXb7aR1oecJ9buJa2SUa/UV1NirPwmPvzy4UXw5EhskU9E4qMRQSJBoy jMQoHHN+42JfaHUthDnAjk9H33SO05RS9jwfg4ljgtWHkoiOaq1FkSdbaoJ6jKAMB+0+ Y8+UVigQiPO/VaPwwUkzSYKuPAMb4/DtAVcZjuJrj7NwhpmZoTIYqiISAZRUohu9lfbj +4bA== MIME-Version: 1.0 X-Received: by 10.180.184.83 with SMTP id es19mr6082694wic.54.1370432697327; Wed, 05 Jun 2013 04:44:57 -0700 (PDT) Received: by 10.194.139.240 with HTTP; Wed, 5 Jun 2013 04:44:57 -0700 (PDT) Date: Wed, 5 Jun 2013 19:44:57 +0800 Message-ID: Subject: Database connection pooling for a recommendation engine From: "Mike W." To: user@mahout.apache.org Content-Type: multipart/alternative; boundary=001a11c228a01ce7f704de66bab1 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c228a01ce7f704de66bab1 Content-Type: text/plain; charset=ISO-8859-1 Hello, I am considering to implement a recommendation engine for a small size website. The website will employ LAMP stack, and for some reasons the recommendation engine must be written in C++. It consists of an On-line Component and Off-line Component, both need to connect to MySQL. The difference is that On-line Component will need a connection pool, whereas several persistent connections or even connect as required would be sufficient for the Off-line Component, since it does not require real time performance in a concurrent requests scenario as in On-line Component. On-line Component is to be wrapped as a web service via Apache AXIS2. The PHP frontend app on Apache http server retrieves recommendation data from this web service module. There are two DB connection options for On-line Component I can think of: 1. Use ODBC connection pool, I think unixODBC might be a candidate. 2. Use connection pool APIs that come as a part of Apache HTTP server. mod_dbd would be a choice.http://httpd.apache.org/docs/2.2/mod/mod_dbd.html As for Off-line Component, a simple DB connection option is direct connection using ODBC. Due to lack of web app design experience, I have the following questions: Option 1 for On-line Component is a tightly coupled design without taking advantage of pooling APIs in Apache HTTP server. But if I choose Option 2 (3-tiered architecture), as a standalone component apart from Apache HTTP server, how to use its connection pool APIs? A Java application can be deployed as a WAR file and contained in a servlet container such as tomcat(See Mahout in Action, section 5.5), or it can use org.apache.mahout.cf.taste.impl.model.jdbc.ConnectionPoolDataSource ( https://cwiki.apache.org/confluence/display/MAHOUT/Recommender+Documentation). Is there any similar approach for my C++ recommendation engine? I am not sure if I made a proper prototype. Any suggestions will be appreciated:) Thanks, Mike --001a11c228a01ce7f704de66bab1--