[Techtalk] cgi vs client-side scripts

Rasjid Wilcox rasjidw at openminddev.net
Tue Mar 11 06:51:44 EST 2003


On Tuesday 11 March 2003 23:12, Patricia Fraser wrote:
> Hi Rasjid & all,
>
> (no need to cc: me, I'm subscribed!)
>
> > On Tuesday 11 March 2003 20:47, Patricia Fraser wrote:
> > > A friend and I are developing a GPL project together, with a MySQL
> > > back end, for live fish producers to do inventory, shipping, export
> > > documentation with (fish exporting is her background, but she loves
> > > tinkering with computers as well). We want it to be multi-platform,
> > > so we plan to use a browser front end and something in the middle
> > > in the way of scripts to talk to the database & do Stuff.
> >
> > Have you considered using Python with wxPython (wxWindows wrapper)
> > instead of a browser front end?  This would give you a 'normal'
> > application with native look and feel on Mac and Windows and GTK look
> > and feel on Linux.  This way you avoid both Apache and the potential
> > multiple browser problem, while still getting cross-platform
> > compatibility.
>
> Wow - right out of left field! A question, though: when I *want* to go
> networked (including intranet/internet), how hard will it be? With the
> MySQL/Apache/browser combo, it shouldn't be to difficult to do, just
> (possibly) difficult to secure. I'm relying heavily on other people's
> networkable programming in these two cases; how much am I likely to
> have to add on to a Python-based front end?

I can't really speak from a lot of experience, as I am just learning all this 
stuff too.  But I will outline some of my thoughts, as I have similar plans 
to yourself (database programs, cross-platform, and fully 
networkable/multi-user), and have had some experience in writing scripts that 
talk to a MySQL backend.

Firstly, if we are assuming a MySQL (or even PostgreSQL) backend, then there 
is no issue with networking.  Communication with the MySQL server is always 
done via tcp/ip, even if that is just to 'localhost'.  So you just have a 
configuration variable that holds the IP address of the MySQL server.  In a 
single system setup, it would be 'localhost', but it could just as easily be 
any IP address, either on a LAN, or across the internet.

The main possibly drawback here is security.  This is probably not a big 
concern in a LAN (MySQL still has user level access restrictions) but if 
connecting to the database across the internet, you way want some type of 
encryption (or even within an LAN in some circumstances).

There are several options here.  Use a SSL wrapper, use SSH port forwarding, 
or go for a full VPN solution.  If you want anyone who has access to the 
database to be able to easly access from anywhere, then some kind of SSL 
arrangement is probably the best.  However, if you want to have an additional 
level of authentication / security (such as using a public/private key 
arrangement), then SSH port-forwarding may be useful.  I have not done the 
SSL thing myself, although I'm fairly confident that it can be done.  
However, I have used SSH port forwarding extensively, and currently maintain 
PySSH (http://pyssh.sf.net) which is a Python library to make doing things 
with SSH from within Python relatively easy.

Just to confuse the issue, I will add in another possibility.  Instead of 
using a relational database backend (eg MySQL), if using Python you could use 
ZODB (the Zope Object Database - http://www.zope.org/Products/ZODB3.1).  This 
way you don't need to translate between your Python objects (assuming that 
you have such things in your code) and database relational tables.  [I know 
very little beyond this at this point in time - exploring ZODB is on my to-do 
list.]  A list of various Object Oriented Databases for various languages is 
at http://www.cbbrowne.com/info/oodbms.html, and I found this article 
(http://www.linux-mag.com/2002-06/database_01.html) quite interesting.

Anyway, I hope that answers your question, although it probably raises several 
more.

Cheers,

Rasjid.



More information about the Techtalk mailing list