-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Hey,
I was thinking about how to best integrate Pgcat with Rails 6.1 without requiring any changes to the application and one way I thought it can be done is to create virtual databases, e.g. one for primaries and one for replicas.
So if the client connects to postgres://pgcat:5432/read
, the connection would be set to use replicas exclusively. If the client connects to postgres://pgcat:5432/write
the client would be set to use primary exclusively. Maybe also do this for shards as well. Under this mode, Pgcat will reject calls to SET SERVER ROLE TO
and SET SHARD TO
This can live side by side with the current implementation, so if the client connects with the default database name, Pgcat just works normally. If they connect to one of the reserved virtual database names, we go into the proposed mode.