Re: Python versus Other Languages using PostgreSQL

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Paul Hughes <paul(at)vivation(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Python versus Other Languages using PostgreSQL
Date: 2017-05-08 22:50:52
Message-ID: 9949aab1-d183-e7b5-0ad7-53cfc8f24657@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 05/08/2017 02:26 PM, Paul Hughes 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!

Postgres does not really care what you use to pull data from it. There
are many libraries across many languages that you can use.

>
> 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?

Because the Python code that does the SELECT * from some_table is not
going to be the part that really determines performance. Performance is
going to be dependent on well provisioned the database is and what you
are using to display the data.

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

See above.

>
> 3) Can PostgreSQL be made to work seamlessly to take advantage of the
> superior performance of HHVM or Node.js?

A quick search on node.js Postgres found:

https://github.com/brianc/node-postgres

http://mherman.org/blog/2015/02/12/postgresql-and-nodejs/#.WRD1XK3TD4Y

php Postgres:

http://php.net/manual/en/book.pgsql.php

https://www.linkedin.com/pulse/how-make-postgresql-db-connections-php-j-c-thomas-rogers-iii

>
>
> Thank you in advance!
>
> ~Paul
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
> Virus-free. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-05-08 22:56:34 Re: [plncek2@gmail.com: Can I safe my Data?]
Previous Message Alvaro Herrera 2017-05-08 22:36:23 [paul@vivation.com: Python versus Other Languages using PostgreSQL]