Pgpool Data Flow – Understanding Data Flow Between Pgpool, PostgreSQL, and Client

pgpoolpostgresql-9.3

I'm new in Pgpool.

I want to ask the question, what is the dataflow between Pgpool, Postgresql when client querying data

1/

  • Client query data to Pgpool,
  • PgPool ask Postgresql
  • Postgresql calculate result, return data to PgPool
  • PgPool transfer data to Client

2/

  • Client query data to PgPool
  • PgPool ask Postgresql
  • Client and Postgresql make a connection
  • Postgresql calculate result,
  • Postgresql directly transfer data to Client

3/ Other schema ?

Could you please show me the right answer

Many thanks

Best Answer

Pgpool is a kind of a layer between client and postgresql. Pgpool receive a query from client and ask Postgresql for data. Postgresql answers to Pgpool and pgpool send data to client like on the picture below. There is not direct connection between client and Postgres when you use Pgpool to connect to database. By the way Pgpool provides connection pooling, replication, load balance, connection limits and paralell query so it's quite nice to use with PGSQL

enter image description here

Manual: http://www.pgpool.net/docs/latest/pgpool-en.html