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:

SizeBest ForTypical Use
1 GBDevelopmentLocal testing, learning
5 GBSmall productionSmall projects, MVP
10 GBMedium productionGrowing apps, moderate data
15 GBMedium-largeEstablished businesses
20 GBLarge productionSignificant data volume
50 GBEnterpriseLarge enterprises
100 GBLarge enterpriseMajor 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#

  1. Click Create Database button
  2. Wait for deployment (usually 2-5 minutes)
  3. Receive confirmation message
  4. Database is created and ready

What Happens During Creation#

Background process:

  1. Allocates storage
  2. Initializes database
  3. Sets root credentials
  4. Configures networking
  5. Enables backups
  6. Runs health checks
  7. 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

# For PostgreSQL
psql -h <hostname> -U root -d postgres
# For MySQL
mysql -h <hostname> -u root -p
# For MongoDB
mongo -h <hostname>:27017 -u root -p
# For Redis
redis-cli -h <hostname> -p 6379

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:

  1. Verify name follows rules (lowercase, no spaces)
  2. Try different storage size
  3. Try different region
  4. Check organization limits
  5. Contact support

Issue: Can't Connect#

Possible causes:

  • Credentials incorrect
  • Application not in network
  • Firewall blocking
  • Database not ready yet

Solutions:

  1. Verify credentials from confirmation
  2. Check firewall rules
  3. Verify hostname is correct
  4. Wait a few minutes if just created
  5. 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#

  1. Connecting to Databases - Connect your applications
  2. Managing Databases - Scale and manage
  3. Backup & Recovery - Data protection

Support#

Questions about database creation?