How to Create Databases: PostgreSQL, MySQL, MongoDB Setup Guide | Nife
Deploy a new managed database in a few simple steps.
Before You Start#
What you need:
- Active Nife organization
- Knowledge of your database needs
- Region preference
What to decide:
- Database type (MySQL, PostgreSQL, MongoDB, etc.)
- Database version
- Storage size
- Region
- Root password
Step 1: Choose Database Type#
Database Options#
PostgreSQL ๐
- Best for: Relational databases, complex queries, enterprise apps
- Versions: 16.1, 15.6, 14.11, 13.14
- Use when: Need ACID compliance, complex joins, advanced features
- Example: Financial systems, analytics platforms
MySQL ๐ฌ
- Best for: Web applications, LAMP stack, content management
- Versions: 8.0.35, 8.0.34, 5.7.44
- Use when: Building WordPress, traditional web apps
- Example: Drupal, Magento, custom web apps
MariaDB ๐ฒ
- Best for: Drop-in MySQL replacement, compatibility needed
- Versions: 11.2.2, 10.11.6, 10.6.16
- Use when: Need MySQL compatibility with newer features
- Example: Migration from MySQL, backward compatibility required
MongoDB ๐
- Best for: Document databases, flexible schema, real-time apps
- Versions: 7.0.5, 6.0.13, 5.0.24
- Use when: Need flexible document structure, JSON data
- Example: Content management, user profiles, logs
Redis โก
- Best for: Caching, sessions, real-time features
- Versions: 7.2.4, 7.0.15, 6.2.14
- Use when: Need high-speed data access, caching layer
- Example: Cache, sessions, real-time analytics
Selection Tips#
- Not sure? PostgreSQL is good for most use cases
- Coming from MySQL? Try PostgreSQL or MariaDB
- Need documents? Use MongoDB
- Need speed? Use Redis for caching layer
- Web shop? MySQL is widely supported
Step 2: Configure Database Settings#
Database Name#
Give your database a clear, descriptive name:
Good names:
- โ production-mysql
- โ app-postgres-main
- โ analytics-database
- โ user-service-db
Bad names:
- โ db1
- โ test
- โ MyDatabase
- โ temp_db
Rules:
- Use lowercase letters
- Use numbers and hyphens
- No spaces
- Max 63 characters
- Should be descriptive
Database Version#
Select the version you want:
Choose the latest version if:
- Starting a new project
- Want newest features
- Need latest security patches
- No compatibility constraints
Choose older version if:
- Migrating existing database
- Need specific feature
- Compatibility required
- Established team preference
Version Support:
- Latest: Full support, frequent updates
- Previous 2: Supported, security patches
- Older: Limited support, may need upgrade
Recommendation: Use latest stable version unless you have a specific reason not to.
Root Password#
Set a strong root password:
Requirements:
- Minimum 8 characters
- Should be complex
- Store securely
- Don't share
Tips for strong passwords:
- Mix uppercase and lowercase:
aBcD - Include numbers:
123 - Include special characters:
!@#$ - Avoid dictionary words
- Avoid personal information
- Example:
SecureP@ss123
Security notes:
- Root password cannot be changed via UI
- Store in password manager
- Note it before creation
- You'll need it to connect
Storage Size#
Choose how much storage your database needs:
| Size | Best For | Typical Use |
|---|---|---|
| 1 GB | Development | Local testing, learning |
| 5 GB | Small production | Small projects, MVP |
| 10 GB | Medium production | Growing apps, moderate data |
| 15 GB | Medium-large | Established businesses |
| 20 GB | Large production | Significant data volume |
| 50 GB | Enterprise | Large enterprises |
| 100 GB | Large enterprise | Major corporations |
Estimate your needs:
- Development: 1-5 GB
- Small app: 5-10 GB
- Medium app: 10-20 GB
- Large app: 50+ GB
You can scale later:
- Increase storage anytime
- No downtime
- Costs adjust accordingly
- Plan ahead but don't over-provision
Region Selection#
Choose where your database will be deployed:
Available Regions:
North America:
- US East (N. Virginia) -
us-east-1 - US West (Oregon) -
us-west-2
Europe:
- EU (Ireland) -
eu-west-1 - EU (Frankfurt) -
eu-central-1
Asia Pacific:
- Asia Pacific (Mumbai) -
ap-south-1 - Asia Pacific (Singapore) -
ap-southeast-1
Choose based on:
User Location:
- Choose closest to majority of users
- Reduces latency
- Better performance
Compliance:
- GDPR: EU regions
- China data residency: Asia regions
- US data: North America regions
Cost:
- Some regions may cost more
- Check pricing
Disaster Recovery:
- Consider backup region
- Use different region for replicas
- Protect against regional outages
Recommendation: Choose closest to your primary users or your location.
Step 3: Review Summary#
Before creating, review your settings:
Summary shows:
- Database Type: PostgreSQL
- Version: 16.1
- Storage: 10 GB
- Region: US East (N. Virginia)
- Root Password: โขโขโขโขโขโขโขโข
Double-check:
- โ Type is correct
- โ Version is desired
- โ Storage is sufficient
- โ Region is preferred
- โ Password was saved
Step 4: Create Database#
- Click Create Database button
- Wait for deployment (usually 2-5 minutes)
- Receive confirmation message
- Database is created and ready
What Happens During Creation#
Background process:
- Allocates storage
- Initializes database
- Sets root credentials
- Configures networking
- Enables backups
- Runs health checks
- Ready for connections
You'll get:
- Hostname/endpoint
- Port number
- Root username
- Root password
- Connection string
- Sample connection code
After Creation#
Next Steps#
1. Save Connection Details
- Write down hostname, port, username, password
- Or copy from connection string
- Store securely
- Use to connect applications
2. Test Connection
3. Create Databases/Schemas
- Log in as root user
- Create application-specific databases
- Create application-specific users
- Set up tables/collections
4. Configure Applications
- Update connection strings
- Set environment variables
- Test connections
- Monitor performance
5. Set Up Backups
- Automatic backups enabled
- Review backup settings
- Test recovery process
Troubleshooting#
Issue: Creation Fails#
Possible causes:
- Invalid name format
- Storage size out of range
- Region unavailable
- Organization quota exceeded
Solutions:
- Verify name follows rules (lowercase, no spaces)
- Try different storage size
- Try different region
- Check organization limits
- Contact support
Issue: Can't Connect#
Possible causes:
- Credentials incorrect
- Application not in network
- Firewall blocking
- Database not ready yet
Solutions:
- Verify credentials from confirmation
- Check firewall rules
- Verify hostname is correct
- Wait a few minutes if just created
- Test from terminal/command line first
Issue: Getting "Password Too Simple"#
Solution:
- Use at least 8 characters
- Mix uppercase and lowercase
- Include numbers
- Include special characters
- Avoid common words
Best Practices#
1. Use Descriptive Names#
- Name should indicate purpose
- Include environment (prod, dev, staging)
- Easy to identify in dashboard
2. Plan Storage#
- Start with what you need
- Add buffer for growth
- Monitor usage
- Scale when reaching 70-80%
3. Choose Correct Version#
- Latest stable is usually best
- Check compatibility needs
- Document your choice
- Plan upgrades in advance
4. Secure Your Password#
- Use strong password
- Store in password manager
- Don't hardcode in files
- Rotate periodically
5. Select Appropriate Region#
- Minimize latency
- Consider compliance
- Plan for backup regions
- Document your choice
6. Monitor After Creation#
- Test connection immediately
- Monitor resource usage
- Check backup status
- Review access logs
Database Comparison#
Relational vs Document#
Choose PostgreSQL/MySQL for:
- Structured data
- Complex relationships
- ACID requirements
- Complex queries
- Financial data
Choose MongoDB for:
- Flexible schema
- Document format
- Unstructured data
- Rapid development
- Semi-structured data
OLTP vs Caching#
Choose Traditional DB for:
- Online transactions
- Business operations
- Complex queries
- Data integrity critical
Choose Redis for:
- Caching layer
- Session storage
- Real-time features
- High speed needed
Next Steps#
- Connecting to Databases - Connect your applications
- Managing Databases - Scale and manage
- Backup & Recovery - Data protection
Support#
Questions about database creation?
- Check sections above
- Review database type guide
- Contact support: [email protected]