-
Notifications
You must be signed in to change notification settings - Fork 19
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
Enable multi-pool client connections #398
Comments
Would you like to work on this feature? This enables a lot of possibilities. |
Actually I am interested :) |
Awesome! 🙌 |
I think this schema is correct not the above one: clients:
active-writes: # <- This is the "named config group"
network: tcp
address: localhost:5432
...
standby-reads:
network: tcp
address: localhost:5433
...
pools:
active-writes:
size: 10
standby-reads:
size: 10
proxies:
active-writes:
healthCheckPeriod: 60s
standby-reads:
healthCheckPeriod: 60s
servers:
default:
distributionStrategy: ab-testing, canary, write-read-split (?), round-robin, murmur-hash, etc.
splitStrategy:
active-writes: 90 # percent
standby-reads: 10 # percent (automatically deduced)
... |
@likecodingloveproblems |
I try to draw the ERD.
|
|
I saw your awesome work you did in this PR. Is this still in progress? |
Hi @mostafa |
I think split strategy is not related to server and must be a distribution strategy's parameter. |
Any updates here? |
@mostafa If I understand correctly, by removing nesting in clients, pools, and proxies, we can separate the server from the group of clients, pools, and proxies. This allows us to have two servers using the same proxy. Is that correct? |
@sinadarbouy No. The idea is to connect a single server instance to multiple proxies, each with different pools and different set of clients. |
In this PR, we introduce a new configuration structure. We have separated the config groups for Additionally, we have implemented the default load balancer strategy, Here is the new configuration structure: # GatewayD Global Configuration
loggers:
default:
...
metrics:
default:
...
clients:
default:
...
default-2:
...
pools:
default:
...
default-2:
...
proxies:
default:
...
default-2:
...
servers:
default:
network: tcp
address: 0.0.0.0:15432
proxies:
- "default"
- "default-2"
loadBalancer:
strategy: ROUND_ROBIN
# Not yet implemented.
# loadBalancingRules:
# - condition: "default"
# percentages:
# - proxy: "default"
# percentage: 70
# - proxy: "default-2"
# percentage: 30
api:
... |
@mostafa Is there anything else you think is important to implement for this issue? For other algorithms, I think it would be better to create separate issues based on need, with more details. |
Hey @sinadarbouy, Thanks for your contributions! 🙏 I think this covers most of the cases, especially those mentioned in this PR. We should create separate tickets for expanding the functionality of this feature. I believe more features and functionality requires authenticated connections in the pool, as mentioned in the following ticket: I created a placeholder ticket to discuss the future enhancements we can build on top of this feature: Thanks @likecodingloveproblems and @ccoVeille for helping make this possible. |
At the moment GatewayD supports a pair of connection pools for managing available and busy connections. On one hand, these pools enables many incoming client, limited by the capacity of the pools, to be connected to a single database server. On the other hand, each client connection is mapped to a single server connection. This works, but is not ideal.
The idea here is to let GatewayD connect to multiple databases at the same time per configuration group, aka. tenant. Each configuration group should have configuration for multiple clients, pools, proxies and a single server. Note that clients, pools and proxies have named groups, yet there will be a single server listening for all of these databases. The
distributionStrategy
and thesplitStrategy
config parameters of the server object will decide how the connection are routed to their corresponding database connections (clients).This should eventually enable a range of possibilities including routing, switching and relaying, to name the least.
This is a possible task list:
This is what the global config might look like after this change, yet other ideas should be explored.
Related
Resources
The text was updated successfully, but these errors were encountered: