> For the complete documentation index, see [llms.txt](https://docs.pandastack.io/v1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandastack.io/v1/getting-started/databases.md).

# Databases

### Introduction

PandaStack's Database Service provides fully managed database solutions that can be easily deployed, monitored, and managed through a simple interface. Our service supports multiple database engines, deployment models, and comprehensive monitoring and backup features to ensure your data remains safe and accessible.

This guide will walk you through the process of creating, configuring, monitoring, and managing your databases on the PandaStack platform.

{% hint style="info" %}

1. Sandbox instances&#x20;
   1. Do not support private endpoint connections. They are only available in publi mode.&#x20;
   2. Have limited number of backups.
   3. Are only meant for development.
   4. Do not support logging and topology.&#x20;
   5. &#x20;Do not support scale-down and may crash if you wish to because of fixed disk size.&#x20;
      {% endhint %}

### Dashboard Overview

The Database Dashboard provides a central location to view and manage all your database deployments. Here you can:

* See a list of all your deployed databases
* Monitor database status at a glance
* Quickly access database details, logs, and metrics
* Create new databases
* Manage existing databases
* Set up monitoring and backups

Each database instance displays key information:

| Column        | Description                                                       |
| ------------- | ----------------------------------------------------------------- |
| Database Name | The unique name of your database                                  |
| Instance Type | The resource tier allocated for the database                      |
| Type          | Database engine (PostgreSQL, MySQL, MongoDB, Redis)               |
| Status        | Current status of the database (running, failed, deploying, etc.) |
| Created By    | User who created the database                                     |
| Version       | Database engine version                                           |
| Actions       | Quick access to management options                                |

### Creating a Database

To create a new database:

1. Click the "**Create Database**" button in the Database Dashboard
2. Select a database **type**
3. Choose between v1 and v2
4. Configure the database parameters
5. Deploy the database

#### Database Types

Our platform supports the following database engines:

* **PostgreSQL**: Advanced, standards-compliant relational database
* **MySQL**: Popular relational database with strong reliability
* **MongoDB**: NoSQL document database for flexible data models
* **Redis**: In-memory data structure store for caching and real-time applications

Each database type has specific configuration options and version choices available.

#### Deployment Options

When creating a database, you'll need to choose between two deployment models:

1. Production ready ( V1) with longer backups, high availability and includes monitoring, topology and other faetures.
2. Sandboxes(V2) - development ready, easy and quick deployment and not preferred to use for production. Cheaper than v1, and DO NOT support high availability, have limited backups.&#x20;

Select the deployment model that best fits your application's requirements and budget.

### Configuring Your Database

#### Basic Configuration

When creating a database, you'll need to provide:

* **Name**: A unique name for your database (lowercase letters, numbers, and hyphens only)
  * Note: A random 6-character suffix will be added to ensure uniqueness
* **Description**: Brief description of the database purpose
* **Version**: The version of the database engine to deploy
* **Region**: Geographic region for deployment (US, EU, or Asia)

For non-Redis databases, you'll also need:

* **Username**: Admin username for database access
* **DB Name**: Name of the default database to create

For all databases:

* **Password**: Secure password for database access
* **Visibility**: Public or private access

#### Server Configuration

For Sandbox server (V2) deployments, you'll need to select:

* **Server Location**: Choose from US, EU, or Asia regions
* **Server Size**: Select a server specification based on your needs:

| Server Size | Specifications                 | Recommended Use Cases            |
| ----------- | ------------------------------ | -------------------------------- |
| PS-01       | 2 vCPU, 2 GB RAM, 40 GB SSD    | Development, testing, small apps |
| PS-02       | 3 vCPU, 4 GB RAM, 80 GB SSD    | Small production apps            |
| PS-03       | 4 vCPU, 8 GB RAM, 160 GB SSD   | Medium workloads                 |
| PS-04       | 8 vCPU, 16 GB RAM, 240 GB SSD  | High traffic applications        |
| PS-05       | 16 vCPU, 32 GB RAM, 360 GB SSD | Enterprise applications          |

For V1 deployments, you'll select from:

* **Instance Type**: Choose from Free, Standard, Compute, or Memory tiers:
  * **Free Tier**: Limited resources, suitable for development
  * **Standard Tier**: Balanced resources for general use
  * **Compute Series**: Optimized for compute-intensive workloads
  * **Memory Series**: Optimized for memory-intensive workloads

#### Database Configuration

Configure database-specific settings:

* **Database Name**: Name of the default database to create
* **Admin Username**: Username for the database administrator account
* **Admin Password**: Password for the database administrator account

#### Backup Configuration

Configure database backup settings:

* **Backup Status**: Enable or disable automated backups
* **Backup Frequency**: Daily, weekly, or monthly backups
* **Retention Period**: Number of days to retain backups (based on your plan)

### Database Details

Once your database is created, you can access detailed information and management options through the database details page.

#### Overview Tab

The Overview tab provides key information about your database:

* **Database Information**: Basic details like name, type, version, and status
* **Connection Information**: Connection URLs for your database
* **Server Information**: Resources allocated to your database
* **Root Credentials**: Access to view and manage database root credentials

#### Monitoring Tab

The Monitoring tab displays real-time and historical metrics for your database:

* **CPU Usage**: CPU utilization over time
* **Memory Usage**: Memory usage in MB
* **Disk Usage**: Storage utilization in GB
* **Active Connections**: Number of active database connections

You can adjust the time range to view metrics for different periods (1 hour, 6 hours, 24 hours, 7 days, or 30 days).

#### Backups Tab

The Backups tab allows you to manage database backups:

* View existing backups
* Trigger manual backups
* Restore from backups
* Configure backup schedules
* See recent backup jobs and their status

#### Settings Tab

The Settings tab provides options to configure your database:

* **Instance Type**: Change the resources allocated to your database
* **Visibility**: Toggle between public and private access
* **Backup Status**: Enable or disable automated backups
* **Connection Strings**: View and copy database connection strings

### Monitoring Your Database

#### Resource Metrics

PandaStack provides comprehensive monitoring for your databases, including:

* **CPU Usage**: Monitor CPU utilization to identify performance bottlenecks
* **Memory Usage**: Track memory consumption to ensure optimal performance
* **Disk Usage**: Monitor storage growth to avoid running out of space
* **Active Connections**: Track the number of active connections to your database

Each metric is displayed in an interactive chart that allows you to:

* Zoom in on specific time periods
* View detailed values at specific points
* Identify trends and patterns in resource usage

#### Database Logs

Database logs provide insights into the operation of your database:

* View real-time logs for your database
* Identify errors and warnings
* Monitor database activity

#### Custom Metrics

Sandboxes server deployments include monitoring capabilities:

* **Database-specific metrics**: Engine-specific metrics for your database type

### Database Backups

#### Backup Schedules

Configure automated backup schedules based on your needs:

* **Daily backups**: Ideal for most production databases
* **Weekly backups**: Suitable for less critical databases
* **Monthly backups**: Minimum recommendation for any database

Backup retention periods vary based on your plan:

* **Free plan**: 7 days retention
* **Pro plan**: 30 days retention
* **Premium plan**: 90 days retention

#### Manual Backups

In addition to scheduled backups, you can create manual backups:

1. Go to the Backups tab in your database details
2. Click "**Take Manual Backup**"
3. Wait for the backup to complete

Manual backups are useful before major changes or updates to your database.

#### Restoring from Backup

To restore from a backup:

1. Go to the Backups tab in your database details
2. Find the backup you want to restore
3. Click the "**Restore**" button
4. Confirm the restoration

**Note**: Restoring a backup will overwrite the current database. This operation cannot be undone.

### Database Security

#### Private vs. Public Databases

PandaStack offers two visibility options for your databases:

* **Private**: Only accessible within your PandaStack organization
  * Use the private connection URL when connecting from your V1 projects
  * More secure for production databases
* **Public**: Accessible from the internet
  * Use the public connection URL when connecting from outside PandaStack
  * Requires proper security measures like strong passwords and SSL

#### Password Management

Manage database passwords securely:

* **Root Password**: View and manage the database root password
* **Password Storage**: All passwords are encrypted at rest

### Maintenance and Upgrades

#### Scaling Resources

As your application grows, you may need to allocate more resources to your database:

1. Go to the Settings tab in your database details
2. Select a new instance type
3. Apply the changes

**Note**: Scaling operations may cause short periods of downtime.

#### Version Upgrades

Database engines regularly release new versions with improvements and security fixes. To upgrade your database version:

1. Create a backup of your current database
2. Create a new database with the desired version
3. Restore your data to the new database
4. Switch your application to the new database
5. Delete the old database when no longer needed

### Troubleshooting

#### Common Issues

**Connection Issues**

* **Problem**: Unable to connect to database
* **Solution**: Verify the connection string and credentials
* **Solution**: Check if database is running
* **Solution**: Verify network connectivity and firewall settings

**Performance Issues**

* **Problem**: Slow query performance
* **Solution**: Check resource utilization in Monitoring tab
* **Solution**: Consider scaling up resources
* **Solution**: Optimize database queries and indexes

**Backup Issues**

* **Problem**: Backup creation fails
* **Solution**: Verify sufficient disk space
* **Solution**: Check database logs for errors
* **Solution**: Contact support if issues persist

### FAQ

**Q: How do I connect to my database from my application?**&#x20;

A: Use the connection URLs provided in the database details page. For private databases, use the private URL when connecting from within PandaStack. For public databases, use the public URL when connecting from outside.

**Q: Can I change my database type after creation?**&#x20;

A: No, the database type cannot be changed after creation. You would need to create a new database and migrate your data.

**Q: What happens if my database runs out of disk space?**&#x20;

A: When disk usage approaches 90%, you'll receive notifications. If the database reaches 100% disk usage, it may become unavailable. Consider scaling up to a larger instance type or cleaning up unnecessary data. Contact <support@pandastack.io> for additional help.

**Q: How do I scale my database as my application grows?**&#x20;

A: You can scale your database by going to the Settings tab and selecting a larger instance type. In Sandbox instances, scale-down MAY NOT be possible beacuse of fixed disk size which cannot be reduced.&#x20;

**Q: Are my database backups encrypted?**&#x20;

A: Yes, all backups are encrypted both in transit and at rest.

**Q: How long does it take to create a new database?**&#x20;

Ans: Database server deployments may take upto 30 minutes in deployments.

**Q: Can I have multiple databases in one instance?**&#x20;

A: Yes, you can create multiple databases within a single database instance. Use the database client tools to create additional databases after deployment.

**Q: What happens if my database crashes?**&#x20;

A: The system will automatically attempt to restart the database. If issues persist, you can restore from a backup or contact support **<support@pandastack.io>**.

***

For additional assistance, please contact our support team.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pandastack.io/v1/getting-started/databases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
