Configuration
Configure cloud database infrastructure.
Available Options
| Option | Description | Default |
|---|---|---|
region | Deployment region | us-west1 |
cpu | vCPU count | 1 |
memory | Memory in MB | 1024 |
storage | Storage in GB | 10 |
Regions
Available Regions
| ID | Location | Provider |
|---|---|---|
us-west1 | Oregon, USA | Railway |
us-east1 | Virginia, USA | Railway |
eu-west1 | Ireland | Railway |
ap-southeast1 | Singapore | Railway |
Choosing a Region
Select based on:
- User proximity - Minimize latency
- Compliance - Data residency requirements
- Cost - May vary by region
Set at Provisioning
postbase cloud provision production -p myapp --region eu-west1Compute Resources
CPU
| vCPUs | Connections | Use Case |
|---|---|---|
| 1 | ~100 | Development |
| 2 | ~200 | Production (small) |
| 4 | ~400 | Production (medium) |
| 8 | ~800 | Production (large) |
Memory
| Memory | Shared Buffers | Use Case |
|---|---|---|
| 1 GB | ~256 MB | Development |
| 2 GB | ~512 MB | Production (small) |
| 4 GB | ~1 GB | Production (medium) |
| 8 GB | ~2 GB | Production (large) |
Recommendations
| Workload | CPU | Memory | Storage |
|---|---|---|---|
| Development | 1 | 1024 | 10 |
| Staging | 1 | 2048 | 25 |
| Production (small) | 2 | 4096 | 50 |
| Production (medium) | 4 | 8192 | 100 |
Storage
Size Options
| GB | Use Case |
|---|---|
| 10 | Development, testing |
| 25 | Small production |
| 50 | Medium production |
| 100 | Large production |
| 250 | Enterprise |
Storage Includes
- Database files
- Indexes
- WAL files (temp)
- Temporary tables
Storage Does NOT Include
- Backups (stored in R2)
- WAL archives (stored in R2)
PostgreSQL Configuration
Default Settings
The PostgreSQL image includes optimized defaults:
max_connections = 100
shared_buffers = 256MB (scales with memory)
work_mem = 4MB
maintenance_work_mem = 64MB
effective_cache_size = 768MB
# WAL Settings (for PITR)
wal_level = replica
max_wal_senders = 10
max_replication_slots = 10Connection Limits
| Memory | max_connections |
|---|---|
| 1 GB | 100 |
| 2 GB | 150 |
| 4 GB | 200 |
| 8 GB | 300 |
Network Configuration
SSL
Railway databases use a proxy that handles SSL termination:
# Use sslmode=disable for Railway proxy
postgresql://...?sslmode=disableConnection Pooling
For high-traffic applications, consider:
-
Application-level pooling:
const db = createClient({ connectionString: '...', pool: { max: 20 } }) -
PgBouncer (coming in HA tier)
Firewall
Railway databases are publicly accessible. Use strong passwords and consider:
- IP allowlisting (coming soon)
- VPN/private networking (coming soon)
Example Configurations
Minimal (Development)
postbase cloud provision dev -p myapp \
--region us-west1 \
--cpu 1 \
--memory 1024 \
--storage 10Cost: ~$5/month
Standard (Production)
postbase cloud provision production -p myapp \
--region us-west1 \
--cpu 2 \
--memory 4096 \
--storage 50Cost: ~$25/month
High Performance
postbase cloud provision production -p myapp \
--region us-west1 \
--cpu 4 \
--memory 8192 \
--storage 100Cost: ~$75/month
Scaling (Coming Soon)
Scale existing databases without downtime:
# Scale up
postbase cloud scale production -p myapp \
--cpu 4 \
--memory 8192
# Scale storage (storage can only increase)
postbase cloud scale production -p myapp \
--storage 100Configuration via API
POST /projects/:project_id/databases
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "production",
"region": "us-west1",
"config": {
"cpu": 2,
"memory": 4096,
"storage": 50
}
}Monitoring Configuration
Check current configuration:
postbase cloud databases info production -p myappDatabase: production
Status: running
Region: us-west1
Configuration:
CPU: 2 vCPU
Memory: 4096 MB
Storage: 50 GB
Used: 12.5 GB (25%)
Performance:
Connections: 45/200
CPU Usage: 15%
Memory Usage: 62%