RDS (Relational Database Service)
Overview
RDS (Relational Database Service) provides managed PostgreSQL and MySQL databases for your application. Tapitalee automatically provisions Amazon RDS instances in your AWS account, handling database setup, backups, and maintenance.
Purpose and Benefits
- Managed Database: Fully managed PostgreSQL or MySQL database with automated backups, patching, and monitoring
- Scalability: Easy vertical scaling by changing instance size without data loss
- High Availability: Optional Multi-AZ deployment for automatic failover
- Security: Automatic encryption at rest and in transit, network isolation via VPC
- Integration: Automatic environment variable injection for seamless app connectivity
CLI Usage
Create RDS Database
tapit create rds engine=<postgres|mysql> name=dbname [variable=DATABASE_URL] [storage=20] [version=14.4] [size=db.t4g.micro] [allowed_ip_ranges=0.0.0.0/0] [multi_az=false]Required Parameters
engine: Database engine (postgresormysql)name: Database name (alphanumeric, used for RDS instance identifier)
Optional Parameters
variable: Environment variable name for connection URL (default:DATABASE_URL)storage: Storage size in GB (default:20)version: Database version (default: latest supported version)size: RDS instance class (default:db.t4g.micro)allowed_ip_ranges: CIDR blocks allowed to connect (default:0.0.0.0/0)multi_az: Enable Multi-AZ deployment for high availability (default:false)
Examples
# Basic PostgreSQL database
tapit create rds engine=postgres name=maindb
# MySQL with custom configuration
tapit create rds engine=mysql name=userdb variable=MYSQL_URL storage=100 size=db.t4g.small multi_az=true
# PostgreSQL with restricted access
tapit create rds engine=postgres name=proddb allowed_ip_ranges=10.0.0.0/16,172.16.0.0/12Modify RDS Database
tapit set rds name=dbname [storage|size|allowed_ip_ranges|multi_az]=valueModifiable Parameters
storage: Increase storage size (cannot decrease)size: Change instance class (requires restart)allowed_ip_ranges: Update network access rulesmulti_az: Enable/disable Multi-AZ deployment
Examples
# Scale up storage
tapit set rds name=maindb storage=200
# Upgrade instance class
tapit set rds name=maindb size=db.t4g.medium
# Enable high availability
tapit set rds name=maindb multi_az=trueList and Show RDS Instances
# List all addons (including RDS)
tapit list addons
# Show specific RDS details
tapit show addon name=dbnameDelete RDS Database
tapit delete addon name=dbnameWarning: This permanently deletes the database and all data. A final snapshot is automatically created before deletion.
Snapshots
Tapitalee automatically takes daily snapshots of RDS instances, retaining 3 days of backups. You can also create manual snapshots:
# Create a manual snapshot
tapit create snapshot addon=dbname name=before-upgrade
# List snapshots
tapit list snapshots addon=dbnameEnvironment Variables
When you create an RDS database, Tapitalee stores the connection details as a Secret Variable in the app’s Variables section. A secure password is automatically generated and embedded in the connection URL.
DATABASE_URL(or custom variable name): Complete connection string, stored as a Secret variable under the app’s Variables
Because it is stored as a Secret variable, the value is only visible to team members with sufficient privileges, and is injected into your application containers at runtime as an environment variable.
Connection String Format
PostgreSQL:
postgres://username:password@hostname:5432/database_nameMySQL:
mysql://username:password@hostname:3306/database_nameSecurity Considerations
- Network Isolation: RDS instances are deployed in private subnets
- Encryption: Data encryption at rest and in transit is enabled by default
- Access Control: Only your Tapitalee application containers have access to the database credentials.
- Credentials: A secure password is automatically generated and stored as a Secret variable in the app’s Variables section, embedded in the
DATABASE_URLconnection string - IP Restrictions: Use
allowed_ip_rangesto limit access to specific networks
Performance and Scaling
Instance Classes
- t4g.micro: 2 vCPUs, 1 GB RAM - Development/testing
- t4g.small: 2 vCPUs, 2 GB RAM - Small applications
- t4g.medium: 2 vCPUs, 4 GB RAM - Medium workloads
- m6g.large: 2 vCPUs, 8 GB RAM - Production workloads
- r6i.large: 2 vCPUs, 16 GB RAM - Memory-intensive applications
Storage Scaling
- Storage can be increased without downtime
- Cannot decrease storage size once allocated
Multi-AZ Deployment
- Provides automatic failover to a standby instance
- Increases cost but improves availability
- Recommended for production workloads