Temporal databases on separate hosts

Can the temporal databases be configured for different hosts? The default seems to be to set the connectAddr property to ‘Env.POSTGRES_SEEDS’ for both databases, which works well for my dev environment but not for staging/production.

Eg.

persistence:
    datastores:
        default:
            sql:
                pluginName: "postgres"
                ...
                connectAddr: "{{ default .Env.DB_HOST "" }}:{{ default .Env.DB_PORT "" }}"
        visibility:
            sql:
                pluginName: "postgres"
                ...
                connectAddr: "{{ default .Env.VISIBILITY_DB_HOST "" }}:{{ default .Env.VISIBILITY_DB_PORT "" }}"

I’ve attempted to validate that this works in my staging environment where the databases exist on separate hosts, but I’m getting some weird errors and first wanted to ask if this type of configuration is possible.

I’m using temporal services base image v1.10.5.

visibility and default DB can be different host / DNS / database

NOTE: helm & existing config template may use the same connection DNS for both default & visibility, but this should be fixed

2 Likes