PostgreSQL & Python vs PHP

G

gene tani

ok, to make this less open-ended, you should mention what O/S and web
server you have in mind, whether the web and DB servers will be under
your admin (big diff betw python and PHP, as far as finding shared
server accounts at web hosts), what kinds of queries, concurrent
read/write volumes, transactions, dirtiness, etc. etc Also if you
build your questions to this newsgroup on past threads you've read, you
will get absolute superb information, I guarantee it.
 
L

Luis P. Mendes

Hi,

I don't know anything about PHP and I'm initiating right now with
PostgreSQL.

Could someone tell me the pros and cons of assessing the PostgreSQL
databases with Python vs. PHP?

I will need to build a database that has to be assessed by a dozen clients
via a web page in an intranet (possibly from outside, too).

Is Python more used on the client side and PHP on the server side?

I now Python, although I'm far from being an expert.


Luis
 
L

Luis P. Mendes

gene said:
To be honest, this is a pretty open-ended question. Are there specific
issues (SQL injection/security, minimizing db connections, simplest
code, etc, your'e concerned with?)
Simplest code with be an important factor, since the db will be used far
from max capabilities. Ease of use of the web page by clients is also a
main factor.

I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?

To be more honest, googline "Python vs. PHP" raises lots of hits
http://wiki.w4py.org/pythonvsphp.html
nice link :)

Thank you,

Luis
 
L

Luis P. Mendes

gene said:
ok, to make this less open-ended, you should mention what O/S and web
server you have in mind, whether the web and DB servers will be under
your admin (big diff betw python and PHP, as far as finding shared
server accounts at web hosts), what kinds of queries, concurrent
read/write volumes, transactions, dirtiness, etc. etc Also if you
build your questions to this newsgroup on past threads you've read, you
will get absolute superb information, I guarantee it.
I'll be using Apache, under Linux.
The db server will be under my admin.
A dozen clients acessing the db.
For the first project:
Three or four of them will be using queries mainly from three tables with:
table 1: 3500000 lines x 20 cols
table 2: 3500000 lines x 6 cols
table 3: 42000000 lines x 5 cols
as an estimate.

Other clients will be very light users but need easy web interface for mouse
clicks only.

Thank you for your support and excuse me for my ignorance, but I'm starting
the project and would like to start it in the right direction.

Luis
 
D

Dennis Lee Bieber

Could someone tell me the pros and cons of assessing the PostgreSQL
databases with Python vs. PHP?
I don't think anyone got confused by the phrasing, though it
could be close...

You are /assessing/ the languages in order to determine which
will be used to /access/ the database.. <G>

Unfortunately, I can't help with the PHP side of the assessment.
I will need to build a database that has to be assessed by a dozen clients
via a web page in an intranet (possibly from outside, too).

Is Python more used on the client side and PHP on the server side?
If you are accessing via a web page, the browser is the client
-- though it may include Javascript/VBScript/Java-applets if client-side
computations are required, I don't think any handle Python applets
(maybe Jython onto the Java runtime) -- so this question doesn't really
make sense. OTOH, Python can be used for stand-alone clients working
directly to the servers using a number of protocols (for example, if the
database is network accessible [dangerous practice as anyone who can
figure out a valid username/password could connect to the database] you
can bypass the web server and browser). PHP, to my knowledge, is
incomplete in that way -- it is essentially a web page processing
language.

As for server side? I also don't know of any servers that were
written in PHP... Whereas CherryPy is a framework for making dedicated
application servers (hope the cherry pickers don't stone me -- I'm
simplifying a lot). Zope includes a server; Plone is built from code on
top of CMF, which itself sits on top of Zope -- all heavily Python
based. And Twisted is... well... twisted through all sorts of network
protocols.


--
 
I

Ivan Voras

Luis said:
I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?

If you know Python and don't know PHP, there's little benefit from
spending the time learning it.

But, PHP is extremely simple to work with and you can produce results
VERY quickly. Part of the reason is that it's already intended to be a
web-embedded language and doesn't reqire additonal frameworks, libraries
or configuration like Python does. One thing that botheres me when using
Python in php-like way is that the "indentation is significant" property
becomes a nuisance when you intertwine HTML and code (which you
shouldn't be doing anyway ;) ).

The benefit of Python is that is a much cleaner language with well
defined interfaces and you'll probably maintain a large application
easier if it's in Python.

There are no significant performance differences, and no really
significant differences in programming approach.
 
B

Bruno Desthuilliers

Luis P. Mendes a écrit :
(snip)
I need to build it from the server and also client side.

For the client side I'll be using Python.

But for the server side, I would like to hear some opinions. Is it worth
learning Php?

I dont think so - unless you have no other choice !-)

More seriously, Python is at least as good (much better IMHO...) as PHP
for web applications, and the only thing (the only I can think of...)
that's really easier to do with PHP is to write unmaintainable code with
all logic and presention mixed up, global variables coming from outer
space, etc...

Another point is that, since you'll need to implement your domain model
in Python for the client app anyway, duplicating it in PHP would not
only be a waste of time, but also lead to a maintence nightmare. Using
Python on both the client and server side, you'll just have to write
specific controllers and views for the web application.

A last thing is that PostgreSQL supports Python as an extension language.

My 2 cents...
 
L

Luis P. Mendes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would like to thank all of you.

For what I've read, I'll be using python instead of Php.


Luis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFC5RQ5Hn4UHCY8rB8RAi3QAKCuU3tgluOZXktbseUmq5d6WpyGCgCfWTCK
hKweHnSkvEm/QLKwMw4uP2A=
=6asH
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,310
Members
47,977
Latest member
MillaDowdy

Latest Threads

Top