Code Monkey home page Code Monkey logo

Comments (7)

davidberardozzi avatar davidberardozzi commented on May 13, 2024 2

Sorry if this is a dumb question: Would it make sense to simply put a pgpool/pgbouncer in front of stolon proxy in order to ensure connection pooling (and only pooling in pgpool case)?

from stolon.

sgotti avatar sgotti commented on May 13, 2024

@thedrow Actually the proxy is just a a dumb tcp proxy so for every incoming tcp connection it opens a tcp connection to the current master. This was done for different needs:

  • Have multiple proxies to avoid any spof.
  • Let the data pass between the client and the proxy untouched.

Keeping a connection pool cannot probably be done with a layer 4 proxy like the actual but needs a layer7 proxy making the proxy talk the postgres protocol with the client and with the server

I understand your requirement since some application aren't keeping an own connection pool but I'm not sure this needs to be a function provided by the stolon proxy since its main purpose is to direct clients to the right master.

Since, for an application, connecting to the stolon proxy is the same as directly connecting to the stolon master (what changes is just the ip to connect to), what about using already existing connection polling mechanism (like pgpool-II in connection pooling mode that will point to the stolon proxy)?

from stolon.

thedrow avatar thedrow commented on May 13, 2024

That is entirely possible but incurs the overhead of transmitting the query and the results through two proxies.
Extending the proxy's capability to be a smarter implementation of pgpool-II will provide more value to the community.
The question is if we want stolon to be a one stop shop for all our PG operational needs or if we'd like to provide a partial solution that will require us to use other components in order to achieve our operational goals.

from stolon.

sgotti avatar sgotti commented on May 13, 2024

Closing since making the proxy a pgpool clone doesn't makes sense and doesn't fit with the stolon architecture. Plus connection pooling should be done by the application.

from stolon.

ccll avatar ccll commented on May 13, 2024

I'd like to ask the same question as @davidberardozzi .
I intend to access stolon from a serverless architecture, where it's hard or even impossible for the application to do the pooling by itself (in the sense that each HTTP endpoint is backed by just one single stateless lambda/function, not a stateful application), an external pooler is required.

from stolon.

sgotti avatar sgotti commented on May 13, 2024

@ccll the stolon-proxy purpose is to redirect to the right master and close connections to old masters, adding connection pooling to it is another feature that will require a lot of work, make the proxy talk at layer 7 and not layer 4 and do all the work that pgpool is already doing (i.e. reset session). The solution is to make your application talks with pgpool and pgpool will point the stolon proxies. The overhead of adding another hop should be negligible.

from stolon.

ccll avatar ccll commented on May 13, 2024

@sgotti External pooling looks cool, I'll try that later, thanks for the tip.

from stolon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.