Skip to Content
InstallationConfiguration

Configuration

Kasho uses environment variables for service configuration and a YAML file for transformation rules.

Environment Variables

pg-change-stream Configuration

VariableDescriptionRequiredExample
KV_URLRedis connection URLYesredis://redis:6379
PRIMARY_DATABASE_URLSource database connection URLYespostgresql://user:pass@host:5432/db
LICENSING_SERVICE_ADDRLicensing service addressYeslicensing:50052

pg-translicator Configuration

VariableDescriptionRequiredExample
CHANGE_STREAM_SERVICE_ADDRpg-change-stream service addressYespg-change-stream:50051
REPLICA_DATABASE_URLTarget database connection URLYespostgresql://user:pass@host:5432/db
LICENSING_SERVICE_ADDRLicensing service addressYeslicensing:50052

pg-bootstrap-sync Configuration

VariableDescriptionRequiredExample
LICENSING_SERVICE_ADDRLicensing service addressYeslicensing:50052

Note: pg-bootstrap-sync also uses command-line flags for configuration. See the Bootstrap Process guide for details.

Database URL Format

Database URLs follow the standard PostgreSQL connection string format:

postgresql://[user[:password]@][host][:port][/database][?param=value&...]

Common Parameters

  • sslmode - SSL connection mode

    • disable - No SSL
    • require - SSL required
    • verify-ca - SSL with CA verification
    • verify-full - SSL with full verification
  • connect_timeout - Connection timeout in seconds (default: 30)

  • application_name - Identifies your application in pg_stat_activity

Examples

# Basic connection without SSL postgresql://kasho:mypassword@localhost:5432/mydb?sslmode=disable # Connection with SSL required postgresql://kasho:mypassword@prod-db.example.com:5432/mydb?sslmode=require # Connection with timeout and app name postgresql://kasho:mypassword@db:5432/mydb?connect_timeout=10&application_name=kasho

Transform Configuration

pg-translicator requires a transforms.yml file that defines how data should be transformed during replication.

File Location

The transforms file must be mounted at /app/config/transforms.yml in the pg-translicator container. How you mount this file depends on your deployment platform:

  • Kubernetes: ConfigMap or Volume mount
  • ECS: Task definition with mounted file from S3 or EFS
  • Docker: Direct volume mount
  • Other platforms: Use your platform’s file mounting mechanism

Basic Structure

version: v1 tables: schema.table_name: column_name: TransformationType

Example Configuration

version: v1 tables: public.users: email: FakeEmail phone: FakePhone address: FakeStreetAddress public.orders: customer_email: FakeEmail billing_address: FakeStreetAddress

See the Transform Configuration guide for detailed information about available transforms.

Production Deployment

For production deployments, mount the transforms configuration using your orchestration platform’s configuration management:

  • Kubernetes: Use ConfigMaps or mounted volumes
  • ECS: Use task definition volumes with S3 or EFS
  • Docker Swarm: Use configs or secrets
  • Other platforms: Follow your platform’s configuration mounting practices

The key requirement is that transforms.yml must be available at /app/config/transforms.yml inside the pg-translicator container.

Configuration Best Practices

  1. Use Environment Files

    • Keep sensitive data in .env files
    • Never commit .env files to version control
    • Use .env.example as a template
  2. Security

    • Use strong passwords for database users
    • Enable SSL for production deployments
    • Restrict network access to services
  3. Monitoring

    • Set meaningful application_name in URLs
    • Monitor replication slot status: SELECT * FROM pg_replication_slots WHERE slot_name = 'kasho_slot'
    • Check pg-change-stream status: grpcurl -plaintext <host>:50051 kasho.ChangeStreamService/GetStatus
    • Check service logs regularly

Next Steps

Last updated on