Open mostafa opened 6 months ago
Hey @likecodingloveproblems,
Would you like to work on this feature? This enables a lot of possibilities.
Actually I am interested :)
Awesome! :raised_hands:
I think this schema is correct not the above one: @mostafa
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
Now that I am rethinking it, it looks better the way you mentioned and also it'll be less nested. And then, the run command, and subsequently the server object, should be aware of non-matching set of config groups, especially in count and label, and then act accordingly based on the given parameters. You can find instances of [name]
, that refer to the config objects in the cmd/run.go file, which will eventually become objects stored in these global variables.
I try to draw the ERD. Now I have two questions:
Hey @likecodingloveproblems,
I saw your awesome work you did in this PR. Is this still in progress?
Hi @mostafa Thanks for your interest. yes, I am working on it in weekends :)
I think split strategy is not related to server and must be a distribution strategy's parameter. also for some strategies we don't need split strategy like round robin.
Hey @likecodingloveproblems,
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.
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
55
Resources