Skip to content

Thoughts on having virtual databases #95

@drdrsh

Description

@drdrsh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions