Python versus Other Languages using PostgreSQL

Started by Paul Hughesalmost 9 years ago24 messagesgeneral
Jump to latest
#1Paul Hughes
paul@vivation.com

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!

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?

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

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

Thank you in advance!

~Paul

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Paul Hughes (#1)
Re: Python versus Other Languages using PostgreSQL

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&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Paul Hughes
paul@vivation.com
In reply to: Adrian Klaver (#2)
Re: Python versus Other Languages using PostgreSQL

Thank you for the links. I'm glad there are other languages that are
working with PostgreSQL. My question still remains though - why is it that
all the largest web platforms that have used PostgreSQL *specifically*
choose Python as their back-end language? Why are Postgres and Python so
married, in the same way that Node.js is largely married to MondogDB?

On Mon, May 8, 2017 at 3:50 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

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.

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Paul Hughes (#3)
Re: Python versus Other Languages using PostgreSQL

On 05/08/2017 05:45 PM, Paul Hughes wrote:

Thank you for the links. I'm glad there are other languages that are
working with PostgreSQL. My question still remains though - why is it
that all the largest web platforms that have used PostgreSQL
*specifically* choose Python as their back-end language? Why are
Postgres and Python so married, in the same way that Node.js is largely
married to MondogDB?

I think you are going to have name frameworks, because AFAIK Drupal uses
PHP, Ruby on Rails uses Rails and so on:

https://en.wikipedia.org/wiki/Comparison_of_web_frameworks

As to why Postgres and Python seem to be attached I would say that is
because about the time people started looking for an alternative to
MySQL/PHP, Python reached the state and breadth of distribution to
became the language to pair with Postgres.

On Mon, May 8, 2017 at 3:50 PM, Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

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.

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Neil Anderson
neil@postgrescompare.com
In reply to: Adrian Klaver (#4)
Re: Python versus Other Languages using PostgreSQL

I'm also interested to know which frameworks you're referring to?

Regarding Node and Mongo I imagine that they are well suited because
Mongo stores JSON documents and Node, being Javascript, has first
class support for JSON. Python and PostgreSQL's relationship might be
more of a principled one? Pythonic being a characteristic not
dissimilar to stable, reliable and of high quality.

On 8 May 2017 at 21:22, Adrian Klaver <adrian.klaver@aklaver.com> wrote:

On 05/08/2017 05:45 PM, Paul Hughes wrote:

Thank you for the links. I'm glad there are other languages that are
working with PostgreSQL. My question still remains though - why is it that
all the largest web platforms that have used PostgreSQL *specifically*
choose Python as their back-end language? Why are Postgres and Python so
married, in the same way that Node.js is largely married to MondogDB?

I think you are going to have name frameworks, because AFAIK Drupal uses
PHP, Ruby on Rails uses Rails and so on:

https://en.wikipedia.org/wiki/Comparison_of_web_frameworks

As to why Postgres and Python seem to be attached I would say that is
because about the time people started looking for an alternative to
MySQL/PHP, Python reached the state and breadth of distribution to became
the language to pair with Postgres.

On Mon, May 8, 2017 at 3:50 PM, Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

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.

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;

<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Neil Anderson
neil@postgrescompare.com
https://www.postgrescompare.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#6Francisco Olarte
folarte@peoplecall.com
In reply to: Paul Hughes (#3)
Re: Python versus Other Languages using PostgreSQL

Paul:

On Tue, May 9, 2017 at 2:45 AM, Paul Hughes <paul@vivation.com> wrote:

....My question still remains though - why is it that all the largest web platforms that have used PostgreSQL *specifically* choose Python as their back-end language?

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.
Also, WHICH platforms are you referring to?

Why are Postgres and Python so married, in the same way that Node.js is largely married to MondogDB?

I do not think either of these is true.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#7Neil Anderson
neil.t.anderson@gmail.com
In reply to: Francisco Olarte (#6)
Re: Python versus Other Languages using PostgreSQL

On 9 May 2017 at 05:26, Francisco Olarte <folarte@peoplecall.com> wrote:

Paul:

On Tue, May 9, 2017 at 2:45 AM, Paul Hughes <paul@vivation.com> wrote:

....My question still remains though - why is it that all the largest web platforms that have used PostgreSQL *specifically* choose Python as their back-end language?

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.
Also, WHICH platforms are you referring to?

Well put. So far I've worked with Flask, Pylons, Rails and ASP.net.
All have an ORM layer (SQLAlchemy, ActiveRecord, EntityFramework) with
support for several database technologies. The framework is specific
and fixed but can pull data from anywhere.

Why are Postgres and Python so married, in the same way that Node.js is largely married to MondogDB?

I do not think either of these is true.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#8Neil Anderson
neil@postgrescompare.com
In reply to: Neil Anderson (#7)
Re: Python versus Other Languages using PostgreSQL

On 9 May 2017 at 06:20, Neil Anderson <neil.t.anderson@gmail.com> wrote:

On 9 May 2017 at 05:26, Francisco Olarte <folarte@peoplecall.com> wrote:

Paul:

On Tue, May 9, 2017 at 2:45 AM, Paul Hughes <paul@vivation.com> wrote:

....My question still remains though - why is it that all the largest web platforms that have used PostgreSQL *specifically* choose Python as their back-end language?

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.
Also, WHICH platforms are you referring to?

Well put. So far I've worked with Flask, Pylons, Rails and ASP.net.
All have an ORM layer (SQLAlchemy, ActiveRecord, EntityFramework) with
support for several database technologies. The framework* is specific
and fixed but can pull data from anywhere.

*The language is specific and fixed but the data can come from anywhere.

Why are Postgres and Python so married, in the same way that Node.js is largely married to MondogDB?

I do not think either of these is true.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Neil Anderson
neil@postgrescompare.com
https://www.postgrescompare.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#9vinny
vinny@xs4all.nl
In reply to: Neil Anderson (#8)
Re: Python versus Other Languages using PostgreSQL

On 2017-05-09 11:26, Francisco Olarte wrote:

Paul:

On Tue, May 9, 2017 at 2:45 AM, Paul Hughes <paul@vivation.com> wrote:

....My question still remains though - why is it that all the largest
web platforms that have used PostgreSQL *specifically* choose Python
as their back-end language?

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.

In fact, I don't think many companies/developers even choose a language
or database, but rather just use whatever they have experience in.

Why are Postgres and Python so married, in the same way that Node.js
is largely married to MondogDB?

I do not think either of these is true.

Perhaps not in real world applications, but the vast majority of
tutorials etc certainly
connect PHP to MySQL, Node to Mongo and Python to PostgreSQL.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#10D'Arcy J.M. Cain
darcy@druid.net
In reply to: Francisco Olarte (#6)
Re: Python versus Other Languages using PostgreSQL

On 2017-05-09 05:26 AM, Francisco Olarte wrote:

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.
Also, WHICH platforms are you referring to?

Perhaps it has something to do with the license. Both Python and
PostgreSQL have a BSD type licence. I wonder if the platform of choice
tends to be one of the BSDs as well.

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VoIP: sip:darcy@druid.net

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#11Guyren Howe
guyren@gmail.com
In reply to: Paul Hughes (#1)
Re: Python versus Other Languages using PostgreSQL

On May 9, 2017, at 2:07 , Paul Hughes <paul@vivation.com> wrote:

Postgres might be a popular choice among Rails devs, but Ruby is not as popular among the big web platforms that choose Postgres.

Ahem.

AirBnB, Bloomberg, Crunchbase, Github, Groupon, Heroku, Hulu, Kickstarter, Scribd, Shopify, Slideshare, SoundCloud, Square, Twitch, Whitepages.

#12Peter Devoy
peter@3xe.co.uk
In reply to: D'Arcy J.M. Cain (#10)
Re: Python versus Other Languages using PostgreSQL

....My question still remains though - why is it that all the largest web platforms that have used PostgreSQL *specifically* choose Python as their back-end language?

If you write the developers a nice tweet or e-mail they might tell
you. Anything else is going to be speculation because there are a
plethora of domain, human and environmental factors which could lead
to language and architecture choices, not least of which is skills
available in the labour market.

Peter

3XE
P: 01326 567155
M: 07770 693662
A: 3XE Ltd
Tremough Innovation Centre
PENRYN
TR10 9TA
3XE Ltd · Registered in England and Wales · 9356871

On 9 May 2017 at 14:45, D'Arcy Cain <darcy@druid.net> wrote:

On 2017-05-09 05:26 AM, Francisco Olarte wrote:

Do you have any data supporting that? AFAIK people tend to choose the
language first, database second, not the other way round, and many
times the platform language is nailed, but the db can be changed.
Also, WHICH platforms are you referring to?

Perhaps it has something to do with the license. Both Python and PostgreSQL
have a BSD type licence. I wonder if the platform of choice tends to be one
of the BSDs as well.

--
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 788 2246     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy@Vex.Net, VoIP: sip:darcy@druid.net

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#13Geoff Winkless
pgsqladmin@geoff.dj
In reply to: Paul Hughes (#1)
Re: Python versus Other Languages using PostgreSQL

On 8 May 2017 at 22:26, Paul Hughes <paul@vivation.com> wrote:

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!

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?

​I've no experience of whether this is true. But in most cases, especially
web platforms, the speed of the language is almost irrelevant. Most
computers are fast enough these days that (for most applications) they
spend most of their time in IO_WAIT, whether you write your code in C or in
shell script. If you have strong experience in a particular language then
​you should use that language, and invest time in optimising your data
structures and developing faster algorithms.

Geoff

#14Francisco Olarte
folarte@peoplecall.com
In reply to: vinny (#9)
Re: Python versus Other Languages using PostgreSQL

On Tue, May 9, 2017 at 1:44 PM, vinny <vinny@xs4all.nl> wrote:

In fact, I don't think many companies/developers even choose a language
or database, but rather just use whatever they have experience in.

That is choosing. You choose them because you know them.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#15George Neuner
gneuner2@comcast.net
In reply to: Paul Hughes (#1)
Re: Python versus Other Languages using PostgreSQL

On Mon, 8 May 2017 14:26:02 -0700, 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!

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?

Most cloud servers come preconfigured with some variation of either
the "LAMP" or "LAPP" stack: i.e. Linux, Apache, MySQL or Postgresql,
PHP or Python.

There needs to be a compelling *application* reason to install
something else: a JVM (or Apache-Tomcat vs regular Apache),
Ruby/Rails, Groovy/Grails, etc.

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

Absolutely. The DBMS is (programming) language neutral - the only
requirement is that a client speak the wire protocol. That can be
done natively, or via a library/driver.

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

Not really sure what you're asking. The application running under
HHVM or node.js is completely separate from Postgresql.

Both PHP and Javascript (generically and for node.js specifically)
have libraries for Postgresql.

George

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#16Steve Crawford
scrawford@pinpointresearch.com
In reply to: Paul Hughes (#1)
Re: Python versus Other Languages using PostgreSQL

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.

Show quoted text

Thank you in advance!

~Paul

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt; Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;
<#m_7020864994226728918_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

#17Paul Hughes
paul@vivation.com
In reply to: George Neuner (#15)
Re: Python versus Other Languages using PostgreSQL

Thank you all for taking the time to answer my questions. I've been out of
the programming world for a long time, so I am back to being a newbie. I
was told this is the place for newcomers to ask questions. I apologize if
my questions did not contain the necessary sophistication or nuance for
some to answer.

George, your answer makes the most sense. Thank you! You said:

Most cloud servers come preconfigured with some variation of either

the "LAMP" or "LAPP" stack: i.e. Linux, Apache, MySQL or Postgresql,
PHP or Python.

There needs to be a compelling *application* reason to install

something else: a JVM (or Apache-Tomcat vs regular Apache),
Ruby/Rails, Groovy/Grails, etc.

<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=icon&gt;
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&amp;utm_source=link&amp;utm_campaign=sig-email&amp;utm_content=webmail&amp;utm_term=link&gt;
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, May 9, 2017 at 7:54 AM, George Neuner <gneuner2@comcast.net> wrote:

On Mon, 8 May 2017 14:26:02 -0700, 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!

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?

Most cloud servers come preconfigured with some variation of either
the "LAMP" or "LAPP" stack: i.e. Linux, Apache, MySQL or Postgresql,
PHP or Python.

There needs to be a compelling *application* reason to install
something else: a JVM (or Apache-Tomcat vs regular Apache),
Ruby/Rails, Groovy/Grails, etc.

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

Absolutely. The DBMS is (programming) language neutral - the only
requirement is that a client speak the wire protocol. That can be
done natively, or via a library/driver.

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

Not really sure what you're asking. The application running under
HHVM or node.js is completely separate from Postgresql.

Both PHP and Javascript (generically and for node.js specifically)
have libraries for Postgresql.

George

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

--
Paul Hughes
Executive Director
Vivation International
1-800-514-8483
Skype: Vivation2
paul@vivation.com
http://www.vivation.com/

#18Dick Kniep
dick.kniep@lindix.nl
In reply to: Francisco Olarte (#14)
Re: Python versus Other Languages using PostgreSQL

As a long time user of the combination, Postgresql, Python, Django,
Flask etc. here are my 2 cents:

The frameworks of python; Django (enormous) or Flask (smaller) and there
are more, are of superb quality, battle hardened and are used in many
many companies and high volume sites around the world. The rigid
implementation of the mvc concept makes for readable, maintainable code.
This is far far more important than execution speed, because:

- most modern application use databases where the IO time is always much
much more important than the speed of processing.

- The power (enormous) of the current hardware is such that extra cycles
do not cost much

- Price (virtually nothing) of the current hardware allows for swift
adding of extra hardware if necessary

- Price of developers is very very high, so any gain in development
speed directly returns to the company as MUCH less expense

- The reliability of the Postgresql has always been a very strong point
(I myself use it since 2002 and have had hardly any problems with it)
even under bad circumstances. The loss of data because of a malfunction
of the database does simply not occur. This comes at a cost (raw speed),
but the cost of loosing data is much much higher than a little extra
hardware.

Cheers

On 09-05-17 16:48, Francisco Olarte wrote:

On Tue, May 9, 2017 at 1:44 PM, vinny <vinny@xs4all.nl> wrote:

In fact, I don't think many companies/developers even choose a language
or database, but rather just use whatever they have experience in.

That is choosing. You choose them because you know them.

Francisco Olarte.

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#19Karsten Hilbert
Karsten.Hilbert@gmx.net
In reply to: Paul Hughes (#3)
Re: Python versus Other Languages using PostgreSQL

On Mon, May 08, 2017 at 05:45:53PM -0700, Paul Hughes wrote:

Why are Postgres and Python so married,

I dare say that's a misconception.

However, Python "works so well", that "professional amateurs"
(like myself) who gravitate towards PostgreSQL for the
obvious reasons might tend to chose Python for the very same
reasons which may seem to create a bias.

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#20Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Paul Hughes (#17)
Re: Python versus Other Languages using PostgreSQL

On 05/09/2017 01:00 PM, Paul Hughes wrote:

Thank you all for taking the time to answer my questions. I've been out
of the programming world for a long time, so I am back to being a
newbie. I was told this is the place for newcomers to ask questions. I
apologize if my questions did not contain the necessary sophistication
or nuance for some to answer.

It has more to do with making unsubstantiated assertions, namely:

"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. ..."

Many on this list(myself included) will want to know how you came to
that conclusion and I am speaking as someone who uses Python, Django and
Postgres.

George, your answer makes the most sense. Thank you! You said:

Most cloud servers come preconfigured with some variation of either

the "LAMP" or "LAPP" stack: i.e. Linux, Apache, MySQL or Postgresql,
PHP or Python.

There needs to be a compelling *application* reason to install

something else: a JVM (or Apache-Tomcat vs regular Apache),
Ruby/Rails, Groovy/Grails, etc.

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#21Paul Hughes
paul@vivation.com
In reply to: Adrian Klaver (#20)
#22Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: Paul Hughes (#17)
#23Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Paul Hughes (#21)
#24John R Pierce
pierce@hogranch.com
In reply to: Adrian Klaver (#23)