Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is Cubejs possible to connect to a set of postgres replicate set? #342

Open
thinhvo-groove opened this issue Jan 8, 2020 · 5 comments
Open
Labels
driver:postgres Issues relating to the Postgres driver enhancement New feature proposal help wanted Community contributions are welcome.

Comments

@thinhvo-groove
Copy link

thinhvo-groove commented Jan 8, 2020

In the need of connecting cubejs to a set of posgres replicate set for scaling and back-up stategy using multiple standby prosgres db instances, is it possible to connect cubejs to a set of posgres relicate set?

Posgres connection string looks like this:
postgresql://host1:123,host2:456/somedb?target_session_attrs=any&application_name=myapp

Thanks.

@paveltiunov
Copy link
Member

@thinhvo-groove Hey Thinh! Great question! Unfortunately there's no easy way to connect to Postgres cluster as there's no support in underlying node-posgres library which is used by driver: brianc/node-postgres#1470. Is it for load balancing? I believe you can use something like HAProxy in front of postgres to do that: https://www.percona.com/blog/2019/11/08/configure-haproxy-with-postgresql-using-built-in-pgsql-check/

@norbertbede
Copy link
Contributor

try this. https://debezium.io/documentation/reference/1.0/postgres-plugins.html

@paveltiunov paveltiunov added help wanted Community contributions are welcome. enhancement New feature proposal labels Nov 25, 2020
@paveltiunov
Copy link
Member

This issue is currently outside of our roadmap and we're looking for contributions here!

@hassankhan hassankhan added the driver:postgres Issues relating to the Postgres driver label Apr 26, 2021
@aobzor
Copy link

aobzor commented Sep 23, 2021

@paveltiunov Are there any news about this issue? We need to support connection to Postgres cluster with cube.js, but it seems still impossible.

Or may be there is a deadline when it will be done.

Thanks.

@Vladislav-Lukyanuk
Copy link

Vladislav-Lukyanuk commented Nov 1, 2021

Hey! Can it be implemented by cube.js it self, as a temporary solution?
If just taking a postgres driver source code as a basis.
It seems to be work as follow:

  1. We can to not create a pool inside a constructor, instead create a async function to get a pool from available hosts.
  2. When a function called next time and a host is alive just return a cached pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver:postgres Issues relating to the Postgres driver enhancement New feature proposal help wanted Community contributions are welcome.
Projects
None yet
Development

No branches or pull requests

6 participants