473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PostgreSQL & Python vs PHP

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
Jul 23 '05 #1
8 2241
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?)

To be more honest, googline "Python vs. PHP" raises lots of hits
http://wiki.w4py.org/pythonvsphp.html
http://www.redcor.ch/wikis/semi_inte...fMoreLanguages

Jul 23 '05 #2
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.

Jul 23 '05 #3
gene tani wrote:
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
Jul 23 '05 #4
gene tani wrote:
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
Jul 23 '05 #5
On Sat, 23 Jul 2005 18:58:47 +0100, "Luis P. Mendes"
<lu*****@XXiname.com> declaimed the following in comp.lang.python:

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.
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 23 '05 #6
Luis P. Mendes wrote:
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.
Jul 24 '05 #7
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...
Jul 24 '05 #8
-----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

iD8DBQFC5RQ5Hn4UHCY8rB8RAi3QAKCuU3tgluOZXktbseUmq5 d6WpyGCgCfWTCK
hKweHnSkvEm/QLKwMw4uP2A=
=6asH
-----END PGP SIGNATURE-----
Jul 25 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: miguelk | last post by:
Excuse my ignorance of this subject since I don't know Python well enough. I would like to know if it's possible to access PostgreSQL (running on Lunux) from Python scripts using TDB (or TBD?). I...
9
by: W. Borgert | last post by:
Hi, I'm not new to Python, but new to databases and PostgreSQL. I like to write a PostgreSQL client application (not code running inside of the RDBMS), and Debian has four modules: ...
4
by: Chuck Amadi | last post by:
Hi all Anyone know a good Pygresql Tutorial for Interfacing between Python & Postgresql . Cheers Chuck
1
by: Mateusz [PEYN] Adamus | last post by:
Hi I'm a developer currently wondering which DB choose for my next project. I looked on the net found ofcourse Oracle but also came up with PostgreSQL. I heard quite few things about it, all...
14
by: Manuel Tejada | last post by:
Hi My box: RedHat 9.0, Pentium III Recently I upgraded from PostgreSQL 7.3.2 to PostgreSQL 7.4.1. The PostgreSQL 7.3.2's rpms were installed from RehHat CDs The PostgreSQL 7.4.1's rpms I used...
2
by: Mike Morris | last post by:
Hi, I've setup a postgres server (7.4) and confirmed that SSL is enabled - I can successfully connect via tcp socket over SSL using the psql client. From PHP4, how can I get the pg_connect...
0
by: Adam Smith | last post by:
Hello, I am attempting to compile postgresql from source with python enable. I have compiled & installed python on my machine according to the instruction, installation seems fine My Platform...
6
by: SR | last post by:
As a starter project for learning Python/PostgreSQL, I am building a Books database that stores information on the books on my bookshelf. Say I have three tables. Table "books" contains rows...
3
by: dpholmes | last post by:
hi everyone, i'm very new to python and to this forum. i'm actually just trying to work through the tutorial on webpy.org. so far, so good, but as i tried to incorporate a postgresql database...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.