> For the complete documentation index, see [llms.txt](https://docs.cloud.olakrutrim.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloud.olakrutrim.com/basics/core-infrastructure/databases.md).

# Databases

## Introduction

Krutrim Cloud Database as a Service (DBaaS) is a fully managed database offering designed to help you build, run, and scale applications without worrying about the operational complexity of database management. With Krutrim Cloud DBaaS, you can provision production-ready databases in minutes while we take care of reliability, availability, scalability, and ongoing maintenance.

Currently, we provide the following managed database engines:

* **Relational Databases (RDBMS):** MySQL and PostgreSQL
* **NoSQL Databases:** MongoDB

These databases are delivered as managed services, meaning we handle critical operational tasks such as database provisioning, patching, backups, replication, monitoring, and failover. This allows you to focus on application development and business logic instead of database administration. This is suitable for a wide range of use cases - from development and testing environments to mission-critical production systems - offering a secure, scalable, and reliable foundation for modern cloud-native applications.

## Choosing the Right Database

**Relational Databases (RDBMS)**\
Relational databases are best suited for applications that require strong consistency, well-defined schemas, and complex queries across related data. You should choose an RDBMS when your workload involves transactional operations, data integrity constraints, joins, or financial-grade accuracy—such as payments, order management, ERP, CRM, or core business systems. Krutrim Cloud DBaaS currently offers **MySQL** and **PostgreSQL** as fully managed relational database services, providing ACID-compliant transactions, reliable performance, and built-in high availability.

**NoSQL Databases**\
NoSQL databases are ideal for workloads that need flexible schemas, horizontal scalability, and high throughput at low latency. They work well for applications dealing with semi-structured or unstructured data, such as user profiles, content catalogs, session stores, event data, and real-time analytics. When your data model evolves frequently or your application needs to scale rapidly, NoSQL is often the better choice. Krutrim Cloud DBaaS currently provides **MongoDB** as a fully managed NoSQL document database, enabling scalable, schema-flexible application development with minimal operational overhead.

## Configurations

Krutrim DBaaS offers predefined instance configurations to simplify capacity planning while covering a wide range of workloads. Each configuration bundles vCPU, RAM, and minimum storage requirements.

<table><thead><tr><th width="151.78125">Tier Name</th><th width="183.609375">Configuration</th><th>Storage Minimum</th><th>Intended Use Case</th></tr></thead><tbody><tr><td>Starter</td><td>2 vCPU, 4 GB RAM</td><td>40 GB</td><td>Small dev/test, low traffic, prototypes.</td></tr><tr><td>Growth</td><td>4 vCPU, 8 GB RAM</td><td>100 GB</td><td>Early production, moderate traffic, few users.</td></tr><tr><td>Business</td><td>8 vCPU, 16 GB RAM</td><td>200 GB</td><td>Production service, steady traffic, analytics.</td></tr><tr><td>Enterprise</td><td>16 vCPU, 32 GB RAM</td><td>400 GB</td><td>High load, mission-critical, many concurrent queries.</td></tr></tbody></table>

## Storage

* Storage is provisioned separately and billed per GB per month.
* Minimum storage is enforced based on the selected tier.
* Users can expand storage at any time without downtime.

## High Availability and Replicas

You can choose a cluster configuration based on your **availability, fault-tolerance, and read-scalability** requirements. Adding replicas improves resilience and allows your database to continue serving traffic even if a node fails.

Krutrim Cloud DBaaS includes **automatic failover** for all replica-based configurations, ensuring high availability with minimal operational effort.

**Automatic failover includes:**

* Continuous health monitoring of the primary node
* Automatic promotion of a healthy replica if the primary node fails
* Minimal disruption to application connectivity
* No manual intervention required

\
We have the following replica configurations for the respective DB engine:

#### MySQL

1. **Two Standby Nodes** - This includes 1 primary and 2 replicas. Each replica has the same compute and storage specs as the primary. Billing becomes 3x, where x is the price of the primary node.
2. **No Standby Node** - This includes only the primary node.

#### PostgreSQL

1. **Two Standby Nodes** - This includes 1 primary and 2 replicas. Each replica has the same compute and storage specs as the primary. Billing becomes 3x, where x is the price of the primary node.
2. **One Standby Node** - This includes 1 primary and 1 replica. The replica has the same compute and storage specs as the primary. Billing becomes 2x, where x is the price of the primary node.
3. **No Standby Node** - This includes only the primary node.

#### MongoDB

1. **Two Standby Nodes** - This includes 1 primary and 2 replicas. Each replica has the same compute and storage specs as the primary. Billing becomes 3x, where x is the price of the primary node.
2. **No Standby Node** - This includes only the primary node.

## Backups

Backups help protect your database from accidental deletion, corruption, or system failures. Krutrim DBaaS provides a flexible, policy-based backup system that lets you automatically create and retain database backups on a schedule you control. Backups are stored securely in Object Storage and can be used later to restore your database to a previous state.

[Learn how to create a backup policy](/basics/core-infrastructure/databases/creating-backups.md)

#### How the Backup System Works

The backup system is built around backup policies. A backup policy defines:

* How often backups are taken (schedule)
* How many backups are retained
* When older backups are automatically deleted

Once configured, backups run automatically without any manual intervention.

### Maximum Backups (Retention)

The **Maximum Backups** setting controls how many backups are retained for your database.

* You can quickly choose common retention values like **3, 7, 14, or 30 backups**, or define a **custom** number.
* When the maximum limit is reached, **older backups are automatically deleted**.
* This helps manage storage costs while ensuring you always have recent restore points available.

**Example:**\
If you select **7 backups** and your schedule runs daily, Krutrim Cloud will always retain the most recent 7 days of backups.

### Backup Schedule

The **Backup Schedule** defines *when* backups are created. This uses a simple, cron-style scheduling system where you can specify one or more of the following fields:

* **Minute (0–59)** – The exact minute the backup runs
* **Hour (0–23)** – The hour of the day
* **Day (1–31)** – Specific day of the month
* **Month** – Specific month(s)
* **Weekday** – Specific day(s) of the week

You can leave fields set to **“Any”** if you don’t want to restrict them.

#### Common Scheduling Examples

* **Every 30 minutes**
  * Minute: `30`
  * Leave all other fields empty
* **Daily at 2:30 AM**
  * Minute: `30`
  * Hour: `2`
* **Weekly backup every Sunday at 3:00 AM**
  * Minute: `0`
  * Hour: `3`
  * Weekday: `Sunday`
* **Monthly backup on the 1st at midnight**
  * Minute: `0`
  * Hour: `0`
  * Day: `1`

## Billing

Billing is based on the compute and storage configuration, as well as the number of replicas.

**Storage** is billed at **Rs 7.88/GB/month**, i.e. Rs 0.01/GB/hour. Storage charges are over and above the configuration price.

Backups are associated with Object Storage buckets, and are billed within the Object Storage section only.&#x20;

{% hint style="warning" %}
Please ensure you have a minimum credit balance of Rs 500, in order to create a new database. Additionally if the credit balance goes below 0, the database is allowed to use upto Rs 1,500 worth of credits, after which the instance will be deleted. It's recommended to create backup policies to avoid data loss in such cases.
{% endhint %}

Here is the billing table for each DB engine, based on configuration selected:

#### MySQL

| Configuration      | Number of Replicas | Price         |
| ------------------ | ------------------ | ------------- |
| 2 vCPU, 4 GB RAM   | 1                  | Rs 3.15/hour  |
|                    | 3                  | Rs 9.45/hour  |
| 4 vCPU, 8 GB RAM   | 1                  | Rs 6.84/hour  |
|                    | 3                  | Rs 20.53/hour |
| 8 vCPU, 16 GB RAM  | 1                  | Rs 16.22/hour |
|                    | 3                  | Rs 48.67/hour |
| 16 vCPU, 32 GB RAM | 1                  | Rs 32.44/hour |
|                    | 3                  | Rs 97.33/hour |

#### PostgreSQL

| Configuration      | Number of Replicas | Price         |
| ------------------ | ------------------ | ------------- |
| 2 vCPU, 4 GB RAM   | 1                  | Rs 3.15/hour  |
|                    | 2                  | Rs 6.30/hour  |
|                    | 3                  | Rs 9.45/hour  |
| 4 vCPU, 8 GB RAM   | 1                  | Rs 6.84/hour  |
|                    | 2                  | Rs 13.69/hour |
|                    | 3                  | Rs 20.53/hour |
| 8 vCPU, 16 GB RAM  | 1                  | Rs 16.22/hour |
|                    | 2                  | Rs 32.44/hour |
|                    | 3                  | Rs 48.67/hour |
| 16 vCPU, 32 GB RAM | 1                  | Rs 32.44/hour |
|                    | 2                  | Rs 64.89/hour |
|                    | 3                  | Rs 97.33/hour |

#### MongoDB

| Configuration      | Number of Replicas | Price         |
| ------------------ | ------------------ | ------------- |
| 2 vCPU, 4 GB RAM   | 1                  | Rs 3.15/hour  |
|                    | 3                  | Rs 9.45/hour  |
| 4 vCPU, 8 GB RAM   | 1                  | Rs 6.84/hour  |
|                    | 3                  | Rs 20.53/hour |
| 8 vCPU, 16 GB RAM  | 1                  | Rs 16.22/hour |
|                    | 3                  | Rs 48.67/hour |
| 16 vCPU, 32 GB RAM | 1                  | Rs 32.44/hour |
|                    | 3                  | Rs 97.33/hour |


---

# 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:

```
GET https://docs.cloud.olakrutrim.com/basics/core-infrastructure/databases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
