Php vs Python gui (tkinter...) for small remote database app

dn PythonList at DancesWithMice.info
Mon Jun 14 16:39:51 EDT 2021


On 15/06/2021 07.17, Pascal B via Python-list wrote:
> Hi,
> I would like to know if for a small app for instance that requires a connection to a remote server database if php is more suitable than Python mainly regarding security.
> Php requires one port for http and one port for the connection to the database open. If using Python with a tkinter gui, I understand a small app can connect to a database so only one port to the database would need to be accessed/open listening to connection. So I would need to worry less about security if using Python over Php for something small, like a small python app that I give over to users.
> 
> Am I missing something in this assertion?

Yes - or maybe I'm missing the point of your question?

There are two connections to consider: the database and the GUI.


Database:

In each case, the programming-language must make a connection to the
Database Management System. The API, the manner for doing-so may vary
slightly between DBMS-es, but will not particularly between languages.
Thus, if we talk about MySQL/MariaDB, the data which must be exchanged
between language and DBMS is identical (even if the code, and appearance
of the 'variables' differs).

As far as security goes, the different DBMS-publishers have decided, in
their wisdom, to select different IP-ports for communication with their
products (see
https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers). Please
refer to (their, cf Python's) specific documentation to ascertain
security and encryption options.


GUI:

There's a bit of 'chalk and cheese' in this question. PHP is built
around HTML. HTML requires an HTTP server (ignoring the interpreter
built-in to a web-browser). Thus, PHP or Python (likely Python plus
Flask or some other framework) will need to connect to
httpd/Apache/NGINX/etc, in similar fashion to the above. In this case,
the choice of IP-port is more standard - 80 for http and 443 for https.

Whereas tkinter is a module which can be import-ed into a Python
program(me). There is no separate server. Thus no need for an
IP-connection between application and front-end.


The (Internet-connected) world runs on TLS. If you wish to
secure/encrypt communications between application and server, this is
accepted by most. If you wish to 'secure' by reducing inter-connections,
then using tkinter and its tight-linkage to Python removes the need for
the (http) web-server.
-- 
Regards,
=dn


More information about the Python-list mailing list