Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Configuration

Configure cloud database infrastructure.

Available Options

OptionDescriptionDefault
regionDeployment regionus-west1
cpuvCPU count1
memoryMemory in MB1024
storageStorage in GB10

Regions

Available Regions

IDLocationProvider
us-west1Oregon, USARailway
us-east1Virginia, USARailway
eu-west1IrelandRailway
ap-southeast1SingaporeRailway

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-west1

Compute Resources

CPU

vCPUsConnectionsUse Case
1~100Development
2~200Production (small)
4~400Production (medium)
8~800Production (large)

Memory

MemoryShared BuffersUse Case
1 GB~256 MBDevelopment
2 GB~512 MBProduction (small)
4 GB~1 GBProduction (medium)
8 GB~2 GBProduction (large)

Recommendations

WorkloadCPUMemoryStorage
Development1102410
Staging1204825
Production (small)2409650
Production (medium)48192100

Storage

Size Options

GBUse Case
10Development, testing
25Small production
50Medium production
100Large production
250Enterprise

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 = 10

Connection Limits

Memorymax_connections
1 GB100
2 GB150
4 GB200
8 GB300

Network Configuration

SSL

Railway databases use a proxy that handles SSL termination:

# Use sslmode=disable for Railway proxy
postgresql://...?sslmode=disable

Connection Pooling

For high-traffic applications, consider:

  1. Application-level pooling:

    const db = createClient({
      connectionString: '...',
      pool: { max: 20 }
    })
  2. 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 10

Cost: ~$5/month

Standard (Production)

postbase cloud provision production -p myapp \
  --region us-west1 \
  --cpu 2 \
  --memory 4096 \
  --storage 50

Cost: ~$25/month

High Performance

postbase cloud provision production -p myapp \
  --region us-west1 \
  --cpu 4 \
  --memory 8192 \
  --storage 100

Cost: ~$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 100

Configuration 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 myapp
Database: 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%