Newbie needs to see a large project

RobE RobMEmmons at cs.com
Mon Oct 6 20:31:53 EDT 2003


> Hi everyone,
> I have been checking Python recently and have presented what little I
> know to mangement.  They have asked if there is any large business apps
> (like an accounting system) using python and what the performance is
> like.  We would be running on Linux with a large database (maybe
> postgres or mysql) of 3-5 Gbytes.  We would be moving from a windows
> platform(foxpro apps) to Linux (python).  About 50 users total.  Thanks
> in advance....

I'll say I'm no expert with databases, but I have played with a 5 GB
stock database on Postgres with python for my personal use.  The comments
I would make are:

*  Yes you can do it.
*  Good thing (and bad thing) is that most of the speed issues will
probably be on the database side.  You need to think carefully about how
you setup the tables and indexes in your database and you need enough
computing horsepower to handle the queries your users are going to do
throw at it.  Complicated queries on large databases can be very time 
consuming, but it all depends on number of records and indexing you use.
*  On the python side--be aware that python data storage is not
particularly efficient in terms of memory.  As an example, in my stock
database an easy way to loadup the daily data would have been to load 
all 30000 symbols for the day at a time and then send it to the 
database--if you define this using classes--it's huge, if you do it 
as a sequence of tuples then it's much smaller--just keep this in 
mind if your doing a lot of data--who you store it in python can matter.
You only need to consider this if you find your using a lot of memory and
need to track down why.
*  Other thing I would suggest -- figure out where the real processing 
needs to be done--if your just handling small amounts of data with
the python clients--then it should not be a problem.  If it's large than
you'll have to experiment--python is still interpretivie on one hand--on
the other for large amounts of data your queries (on the database side)
may still be the limiting factor.  Also keep in mind if you need to you
can extend python with C code if you have to get speed.  There is also
"good" and "bad" python code--so be creative.
*  Python can be used for large programs -- I've written a 10000 line
python program without difficulty.  The other two common scripting
langauges out there are PHP and Perl.  I don't know much about these, but
I heard people say you'd never write large Perl code like this.  PHP I
don't know...people do use this for web/db work a lot.  Incidently, the
python active content web solution is Zope... but I'm not a web guy so I
don't know anything about it.
*  I don't know how much you've done with databases--but a reminder.
Have a backup plan.  You can't just run tar over a running database and get
a restorable backup--you'll need to dump the database using whatever
procedure postgres has for this and then backup the static dump.
*  Incidently:  The reason I use python myself is that it has a large
application range--it can do everything from quick tools to full up
applications, to active web content.  Pretty flexible. 

Just some food for thought.

Rob




More information about the Python-list mailing list