Database Support
PostgreSQL
ProductionFully supported relational database with:
- ACID compliance
- Replication support
- Advanced querying
- Horizontal scaling
SQLite
Development OnlyEmbedded database for local development:
- No server setup needed
- File-based storage
- Limited concurrency
PostgreSQL Setup
Using Docker Compose
The easiest way is to use the provided Docker Compose configuration:docker-compose.yml
Manual Installation
- Ubuntu/Debian
- macOS
- Docker
Create Database
1
Connect to PostgreSQL
2
Create database
3
Create user (optional)
4
Verify connection
Database Configuration
Configure Activepieces to connect to PostgreSQL:Basic Configuration
.env
Connection URL
Alternatively, use a connection URL:.env
The connection URL format is:
postgresql://[user[:password]@][host][:port][/database][?param1=value1&...]SSL Configuration
Enable SSL for secure connections:.env
.env
disable: No SSLrequire: SSL requiredverify-ca: Verify CA certificateverify-full: Verify CA and hostname
Connection Pooling
Configure connection pool for better performance:.env
Pool size guidelines:
- Development: 5-10
- Production (single instance): 10-20
- Production (multiple instances): Calculate
total_connections / instance_count
Database Migrations
Activepieces uses TypeORM for database migrations. Migrations run automatically on startup.Migration Process
When Activepieces starts:- Connects to the database
- Checks for pending migrations
- Applies migrations in order
- Logs migration results
- Community Edition:
packages/server/api/src/app/database/migration/ - Enterprise Edition:
packages/server/api/src/app/ee/database/migrations/
Manual Migration
To run migrations manually:Database Entities
Activepieces creates the following tables (source:database-connection.ts:60):
Core Entities
Core Entities
- flow: Workflow definitions
- flow_version: Workflow versions
- flow_run: Execution logs
- project: Projects (workspaces)
- user: User accounts
- file: File storage metadata
- trigger_event: Trigger events
- app_connection: OAuth and API connections
Pieces & Integrations
Pieces & Integrations
- piece_metadata: Integration metadata
- tag: Tags for organizing pieces
- piece_tag: Many-to-many piece-tag relationships
- app_event_routing: Event routing rules
- trigger_source: Webhook trigger sources
Storage
Storage
- store_entry: Key-value storage
- table: Database tables
- field: Table columns
- record: Table rows
- cell: Table cell values
Enterprise
Enterprise
- project_member: Team members
- project_role: Custom roles
- api_key: API keys
- audit_event: Audit logs
- custom_domain: Custom domains
- oauth_app: Custom OAuth apps
- signing_key: JWT signing keys
Database Maintenance
Backups
- pg_dump
- Docker
- Automated
Create a full database backup:
Restore
1
Stop Activepieces
2
Drop database
3
Create new database
4
Restore backup
5
Restart Activepieces
Vacuum and Analyze
Regularly optimize the database:Performance Tuning
PostgreSQL Configuration
Editpostgresql.conf for better performance:
postgresql.conf
Indexes
Activepieces creates indexes automatically, but you can verify:Monitoring
Monitor database performance:High Availability
PostgreSQL Replication
Setup master-replica replication:1
Configure Master
Edit Edit
postgresql.conf on master:pg_hba.conf:2
Create replication user
3
Setup replica
standby.signal file:Using Managed Services
Cloud PostgreSQL services with built-in HA:AWS RDS
Multi-AZ deployments with automatic failover
.env
Google Cloud SQL
High availability with regional replication
.env
Azure Database
Zone-redundant HA with read replicas
.env
SQLite (Development)
For local development only:.env
activepieces.db in the working directory.
Troubleshooting
Connection refused
Connection refused
Check PostgreSQL is running:Verify port is open:Test connection:
Authentication failed
Authentication failed
Check Allow connections:Reload PostgreSQL:
pg_hba.conf:Too many connections
Too many connections
Check active connections:Increase max_connections:Adjust pool size:
postgresql.conf
.env
Disk space full
Disk space full
Check database size:Vacuum to reclaim space:Enable data retention:
.env
Next Steps
Storage
Configure file storage with S3
Scaling
Scale your database
Backup Strategy
Implement backup automation
Monitoring
Setup database monitoring