Connect your application to PostgreSQL, MySQL, MongoDB, Redis, and more with secure, managed database solutions.
CupaDev integrates with all major database providers:
Powerful relational database with advanced features
Popular open-source relational database
NoSQL document database for flexible schemas
In-memory cache for blazing-fast data access
Connect your database using environment variables:
Obtain your database connection string from your database provider. It typically looks like:
postgresql://user:password@host:5432/databaseIn your CupaDev project settings, add the connection string as an environment variable:
DATABASE_URLpostgresql://...Production, Preview, DevelopmentAccess the connection string in your code:
// Node.js / Next.js
import { Client } from 'pg';
const client = new Client({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false }
});
await client.connect();These providers offer excellent integration with CupaDev:
Open-source Firebase alternative with real-time subscriptions, authentication, and storage.
Visit Supabase →Serverless PostgreSQL with branching, autoscaling, and generous free tier.
Visit Neon →Serverless MySQL with database branching, schema migrations, and horizontal scaling.
Visit PlanetScale →Serverless Redis with per-request pricing, REST API, and global replication.
Visit Upstash →Fully managed MongoDB with automatic scaling, backups, and security features.
Visit MongoDB Atlas →For serverless environments, use connection pooling to avoid exhausting database connections:
// Add to your connection string
DATABASE_URL="postgresql://user:pass@host:5432/db?pgbouncer=true&connection_limit=1"
// prisma/schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}// PlanetScale automatically handles connection pooling DATABASE_URL="mysql://user:pass@host/db?sslaccept=strict"
Always enable SSL/TLS for database connections in production:
ssl={ rejectUnauthorized: false }Use different databases for production, preview, and development environments. Never share production databases with test environments.
Regularly rotate database passwords and connection strings, especially when team members change.
Use IP whitelisting or VPC peering to restrict database access to authorized networks only.
Check that:
Add ssl: { rejectUnauthorized: false } to your connection config, or ensure your SSL certificate is valid.
Use connection pooling or limit concurrent connections:
connection_limit=1 in connection string