Overview
Infinitic supports multiple storage backends:- Redis - Fast, in-memory data store (recommended for most use cases)
- PostgreSQL - Reliable relational database
- MySQL - Popular relational database
- In-Memory - For development and testing only
storage section.
What Gets Stored
Infinitic persists:- Workflow state - Current workflow execution state and history
- Task state - Task execution status and results
- Deferred messages - Scheduled tasks and timers
- Tags - Custom identifiers for workflows and tasks
Redis Storage
Redis is the recommended storage backend for production use, offering excellent performance and reliability.Basic Configuration
Complete Configuration
Redis Parameters
Redis server hostname or IP address. Cannot be blank.Example:
localhost or redis.example.comRedis server port number. Must be greater than 0.Default:
6379Username for Redis authentication (Redis 6+).
Password for Redis authentication.
Redis database index to use. Must be >= 0.Default:
0Socket timeout in milliseconds.Default:
2000Enable SSL/TLS connection to Redis.Default:
falseConnection Pool Configuration
Maximum number of connections in the pool. Use -1 for unlimited.Default:
-1Maximum number of idle connections in the pool.Default:
8Minimum number of idle connections to maintain.Default:
0Configuration via Code
PostgreSQL Storage
PostgreSQL provides ACID-compliant persistent storage with excellent reliability.Basic Configuration
Complete Configuration
PostgreSQL Parameters
PostgreSQL server hostname or IP address.Example:
localhost or postgres.example.comPostgreSQL server port number.Default:
5432Database username for authentication.
Database password for authentication.
Database name. Must be a valid PostgreSQL database name.Default:
postgresSchema name within the database. Created automatically if it doesn’t exist.Default:
infiniticTable name for key-set storage. Created automatically if it doesn’t exist.Default:
key_set_storageTable name for key-value storage. Created automatically if it doesn’t exist.Default:
key_value_storageConnection Pool Parameters
Maximum number of connections in the HikariCP pool. Must be > 0.Default: HikariCP default (10)
Minimum number of idle connections. Must be >= 0.Default: HikariCP default (same as maximumPoolSize)
Maximum time (in milliseconds) a connection can sit idle in the pool. Must be > 0.Default: HikariCP default (600000ms / 10 minutes)
Maximum time (in milliseconds) to wait for a connection from the pool. Must be > 0.Default: HikariCP default (30000ms / 30 seconds)
Maximum lifetime (in milliseconds) of a connection in the pool. Must be > 0.Default: HikariCP default (1800000ms / 30 minutes)
Database Setup
Infinitic automatically creates the database, schema, and tables if they don’t exist. Ensure the configured user has appropriate permissions:Configuration via Code
MySQL Storage
MySQL provides reliable persistent storage with wide adoption.Basic Configuration
Complete Configuration
MySQL Parameters
MySQL server hostname or IP address.Example:
localhost or mysql.example.comMySQL server port number.Default:
3306Database username for authentication.
Database password for authentication.
Database name. Must be a valid MySQL database name.Default:
infiniticTable name for key-set storage. Created automatically if it doesn’t exist.Default:
key_set_storageTable name for key-value storage. Created automatically if it doesn’t exist.Default:
key_value_storageDatabase Setup
Configuration via Code
In-Memory Storage
Data Compression
Enable compression to reduce storage size and network bandwidth:Compression algorithm for stored data.Options:
gzip- Good balance of speed and compression ratio (recommended)bzip2- Better compression, slowerdeflate- Similar to gzip
- Large workflow states
- Workflows with significant data payloads
- Reducing network transfer costs
Caching
Enable in-memory caching to reduce database load:Cache Parameters
Maximum number of key-value entries to cache.Default: No caching
Seconds after last access to expire cached entries.Default: No expiration
Maximum number of key-set entries to cache.Default: No caching
Seconds after last access to expire cached entries.Default: No expiration
Storage Selection Guide
Choose Redis when:
- You need high performance with sub-millisecond latency
- Your infrastructure already uses Redis
- You want simplicity with excellent performance
- Memory cost is acceptable for your data size
Choose PostgreSQL when:
- You need ACID compliance and strong consistency
- You prefer relational databases
- You have existing PostgreSQL infrastructure
- Long-term data retention is critical
- You need complex querying capabilities
Choose MySQL when:
- Your organization standardizes on MySQL
- You have existing MySQL expertise and infrastructure
- Requirements are similar to PostgreSQL
Production Best Practices
High Availability
- Redis: Use Redis Cluster or Redis Sentinel for HA
- PostgreSQL: Configure streaming replication with automatic failover
- MySQL: Set up MySQL Group Replication or master-slave replication
Backups
- Schedule regular backups of your storage backend
- Test restore procedures regularly
- Consider point-in-time recovery capabilities
- Store backups in a different geographic region
Monitoring
Monitor these key metrics:- Connection pool utilization
- Query latency (p50, p95, p99)
- Storage capacity and growth rate
- Error rates and failed queries
- Cache hit rates (if caching enabled)
Security
- Encryption at rest - Enable database encryption
- Encryption in transit - Use SSL/TLS connections
- Access control - Use dedicated users with minimal privileges
- Network isolation - Keep storage in private network
- Secrets management - Use environment variables or secret managers for passwords
Performance Tuning
For Redis:
For PostgreSQL/MySQL:
Migration Between Backends
When migrating between storage backends:- Plan for downtime - Migration requires stopping active workflows
- Export data - Use backup/export tools for your current backend
- Transform data - Adapt data format if necessary
- Import data - Load into new backend
- Validate - Verify all data migrated correctly
- Update configuration - Point workers to new storage
Troubleshooting
Connection Issues
Symptom: “Connection refused” or “Timeout” errors Solutions:- Verify host and port are correct
- Check firewall rules allow connections
- Ensure storage service is running
- Verify network connectivity
Performance Issues
Symptom: Slow workflow execution or high latency Solutions:- Increase connection pool size
- Enable compression to reduce data transfer
- Add caching to reduce database load
- Scale your storage backend (add replicas/shards)
- Check database query performance
Storage Growth
Symptom: Database size growing rapidly Solutions:- Enable compression
- Review data retention policies
- Archive completed workflows
- Monitor for workflow memory leaks
Next Steps
- Pulsar Transport - Configure message transport
- Deployment - Deploy to production