Re: [GENERAL] Python versus Other Languages using PostgreSQL

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Re: [GENERAL] Python versus Other Languages using PostgreSQL
Дата
Msg-id CAEfWYyzVwskoXEHCaiGS7+RSa2ETtvUAZAVGbqLgpUkuAUrtcg@mail.gmail.com
обсуждение исходный текст
Ответ на [GENERAL] Python versus Other Languages using PostgreSQL  (Paul Hughes <paul@vivation.com>)
Список pgsql-general
On Mon, May 8, 2017 at 2:26 PM, Paul Hughes <paul@vivation.com> wrote:
Hello,

I noticed that most of the largest web platforms that use PostgreSQL as their primary database, also use Python as their primary back-end language. Yet, according to every benchmark I could find over the last couple of years, back-end languages like PHP, HHVM, and Node.JS outperform Python by 2x to 8x!

This is a questionable and incomplete starting point starting with a vague assertion lacking a reasonable set of examples.

You are conflating languages (PHP, Python) with various environments in which they run (the Node.js runtime for Javascript and HHVM virtual machine for PHP/Hack), failing to provide version/implementation/acceleration information of the languages (Zend, PyPy,), and failing to state anything about the environment: Is it raw code or are we actually discussing framework performance? What are other requirements/constraints on the overall system?

Picking a single data-point (speed) of a single part of a system (back end language) is not typically informative. There is speed of development, availability of developers, feature sets, robustness, licensing, availability of commercial support, security issues and ability to integrate with other parts of a corporate environment to name just a few. The impact of the language speed may be minuscule compared to the impact of other aspects of the overall system. One could as easily ask, "Why do so many people use PHP when assembler is so much faster?"

If speed is the only requirement you can get a great boost in PostgreSQL by turning off fsync. Of course you may lose all your data in a crash but, hey, it's faster!

To quote our own illustrious Tom Lane:

"...Try to carry 500 people from Los Angeles to Tokyo in an F-15.  No?  Try to win a dogfight in a 747.  No? But they both fly, so it must be useful to compare them...  especially on the basis of the most simplistic test case you can think of.  For extra points, use *only one* test case.  Perhaps this paper can be described as "comparing an F-15 to a 747 on the basis of required runway length...". 

To really determine the answer you would have to ask each one why they chose their specific combination of language(s) database, OS, hardware/VM, caching, pooling, etc.; what they would do differently in retrospect and also evaluate the validity of those decisions. For the most part we, here, can only guess.



So here are my questions:

1) Why do the largest web applications that use PostgreSQL also use Python, even though Python is significantly slower than it's biggest competitors?

See comments above.
 

2) Can PostgreSQL just as easily be used with PHP or Node.js? If not, why not?


Yes. We have PHP, Python, Ruby, C, Bash (via psql), Perl, LibreOffice, etc. directly connecting to our server. There is also client support for Java, .NET, Tcl, C++, ODBC, Erlang, Haskell, Lua, R, Smalltalk, ...
 
3) Can PostgreSQL be made to work seamlessly to take advantage of the superior performance of HHVM or Node.js?

See above.
 


Thank you in advance!

~Paul

Virus-free. www.avast.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "Armand Pirvu (home)"
Дата:
Сообщение: Re: [GENERAL] data transformation and replication
Следующее
От: Rajesh Mallah
Дата:
Сообщение: [GENERAL] logging of application level user in audit trigger