Whizan Cloud ServicesDocumentation Hub
Documentation/Compute & Applications/Managed Persistence

Managed Persistence

Supported:PostgreSQL 16Redis 7PgBouncer Connection Pooling

When to Use This Service

Ideal Use Cases
  • Relational structured data storage for users, transactions, orders, and business entities (PostgreSQL)
  • High-speed session storage, rate limiting, and caching layers (Redis)
  • Message queues and pub/sub brokers for asynchronous microservice communication (Redis)
  • Applications using ORMs like Prisma, Drizzle, TypeORM, SQLAlchemy, or GORM
When to Choose Another Workload
  • Unstructured cold storage or static media files (use S3-compatible object storage instead)
  • Client-side direct connections without authentication middleware

How to Use & Deploy

Option 1Deploy via Web Console

  1. 1Go to 'Databases' in the sidebar navigation.
  2. 2Click 'Provision Database' and select either PostgreSQL or Redis.
  3. 3Choose your database name and compute allocation tier.
  4. 4Once provisioned, copy your direct connection string (DATABASE_URL or REDIS_URL).
  5. 5Add this connection string to your Backend Microservice or Edge Function environment variables.

Option 2Deploy via CLI & Terminal

Deploy instantly from your local workspace terminal using the global Whizan CLI:

$ whizan db create --type postgresql --name core-db
Or prompt your AI Coding Assistant (Cursor / Antigravity MCP):
“Provision a PostgreSQL database and configure connection string for my backend”

Practical Project Example

db.ts
import { Pool } from "pg";

// Connect seamlessly using the standard DATABASE_URL environment variable
export const pool = new Pool({
  connectionString: process.env.DATABASE_URL,
  ssl: process.env.NODE_ENV === "production" ? { rejectUnauthorized: false } : false,
  max: 10,
  idleTimeoutMillis: 30000,
});

export async function query(text: string, params?: any[]) {
  const start = Date.now();
  const res = await pool.query(text, params);
  const duration = Date.now() - start;
  console.log("Executed query", { text, duration, rows: res.rowCount });
  return res;
}

Configuration Reference

Parameter / SettingDescriptionDefault / Recommended
Database EngineDatabase engine type (PostgreSQL or Redis)PostgreSQL
Connection PoolerIntegrated connection pooler for serverless concurrency spikesEnabled
SSL / TLSEnforce TLS encrypted transport for all database queriesEnforced

Best Practices & Pro Tips

Tip 1Always connect via the pooled connection string when querying from serverless functions to avoid connection exhaustion.
Tip 2Use database migrations (e.g. Prisma Migrate, Alembic) within your deployment pipeline to keep schemas in sync.