Configuration
Kasho uses environment variables for service configuration and a YAML file for transformation rules.
Environment Variables
pg-change-stream Configuration
| Variable | Description | Required | Example |
|---|---|---|---|
KV_URL | Redis connection URL | Yes | redis://redis:6379 |
PRIMARY_DATABASE_URL | Source database connection URL | Yes | postgresql://user:pass@host:5432/db |
LICENSING_SERVICE_ADDR | Licensing service address | Yes | licensing:50052 |
pg-translicator Configuration
| Variable | Description | Required | Example |
|---|---|---|---|
CHANGE_STREAM_SERVICE_ADDR | pg-change-stream service address | Yes | pg-change-stream:50051 |
REPLICA_DATABASE_URL | Target database connection URL | Yes | postgresql://user:pass@host:5432/db |
LICENSING_SERVICE_ADDR | Licensing service address | Yes | licensing:50052 |
pg-bootstrap-sync Configuration
| Variable | Description | Required | Example |
|---|---|---|---|
LICENSING_SERVICE_ADDR | Licensing service address | Yes | licensing: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 modedisable- No SSLrequire- SSL requiredverify-ca- SSL with CA verificationverify-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=kashoTransform 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: TransformationTypeExample Configuration
version: v1
tables:
public.users:
email: FakeEmail
phone: FakePhone
address: FakeStreetAddress
public.orders:
customer_email: FakeEmail
billing_address: FakeStreetAddressSee 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
-
Use Environment Files
- Keep sensitive data in
.envfiles - Never commit
.envfiles to version control - Use
.env.exampleas a template
- Keep sensitive data in
-
Security
- Use strong passwords for database users
- Enable SSL for production deployments
- Restrict network access to services
-
Monitoring
- Set meaningful
application_namein 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
- Set meaningful
Next Steps
- Set up the Bootstrap Process for existing data
- Configure Data Transforms
- Review the Quick Start guide