Jean-Sebastien Stoezel wrote:
> While I will be distributing the source code - which as you underline
> it - can be reviewed and modified by any user, the database this code
> is supposed to access will be shared by all the users. This is not a
> database that will run locally on the users' machine. This will be a
> remote common place to gather information about the users.
In that case, I recommend a standard 3-tier architecture: the client
talks to a server you write which in turn talks to the database server.
The protocol between the first two tiers can be any sort of networked
IPC or RPC you like: HTTP, XML-RPC, ONC RPC, UDP packets, a custom TCP
protocol, whatever. You need to be careful how you choose or design the
protocol, because it will affect how easy it is to validate the incoming
The middle tier program inspects each incoming request, and updates the
database if it looks sane. You build it with the same sort of sanity
checking you would use in the server-side code of a web application. In
addition to the validation, this lets you provide a much more
restrictive API than libmysqlclient. Your users can only do what your
The middle tier program must reside on hardware you control for this to
do you any good. Unless your load is so heavy you need to partition the
server parts so they live on two different machines, it goes on the same
machine as the DB server.