# OvalEdge DB on AWS RDS

This article provides step-by-step instructions to provision an AWS MySQL-compatible RDS instance for the OvalEdge platform. It includes prerequisites, database creation, schema setup, and execution of OvalEdge database scripts to prepare the backend for application deployment.

## Prerequisites

Ensure the following requirements are met before starting the setup:

* **AWS Account Access**: An active AWS account with permissions to create and manage RDS resources.
* **AWS Management Console Access**: Ability to log in and navigate to the RDS service.
* **MySQL Client or GUI Tool Installed**: Tools such as MySQL Workbench, DBeaver, or the MySQL CLI should be available on your local machine or EC2 instance.

## Create MySQL Database in RDS

Follow the steps below to provision a new MySQL-compatible RDS instance:

1. Log in to the **AWS Management Console** and navigate to **RDS**.
2. Click **Create database**.

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/RlsaF4QLY4nS5b7e4hkn/image.png" alt=""><figcaption></figcaption></figure>
3. Select **Standard Create**.

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/kRClEgOlVvzGuhFe4T7s/image.png" alt=""><figcaption></figcaption></figure>
4. Choose **MariaDB** as the engine.

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/1ayPws7FvJnsbtYwnx6V/image.png" alt=""><figcaption></figcaption></figure>
5. Under **Version**, select the latest available in the **8.4.x** series.

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/8xAk5p65alVDF4dU2dwQ/image.png" alt=""><figcaption></figcaption></figure>
6. Select a **template** based on workload (e.g., *Production* or *Dev/Test*).

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/MMuellnEQPJpRwMi7jBX/image.png" alt=""><figcaption></figcaption></figure>
7. Enter a **DB instance identifier** (e.g., `ovaledge-db`).

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/QyqRrB79V28mShUAmpHW/image.png" alt=""><figcaption></figcaption></figure>
8. Set the **Master username**, then either:
   * Auto-generate the password, or
   * Enter a custom secure password.

     <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/K1W2r7rSoVZVxQ0Y60A6/image.png" alt=""><figcaption></figcaption></figure>
9. Choose the desired **DB instance class** (e.g., `db.t3.medium`) based on performance needs.

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/KUcnFtH7ucnaJ2BlumQJ/image.png" alt=""><figcaption></figcaption></figure>
10. Configure **Storage type** and allocate a minimum of **100 GB**.<br>

    <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/oA2l2QL7Wzkb2zjQXP8A/image.png" alt=""><figcaption></figcaption></figure>
11. Under **Connectivity**, configure VPC, subnet group, and security groups as required.<br>
12. Expand **Additional Configuration** and set any custom DB parameters.<br>

    <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/nnmaWAioluLpDGjG71cT/image.png" alt=""><figcaption></figcaption></figure>
13. Set **Public access** to **Yes** if remote connections are required.<br>

    <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/M7lmWOYhXOSVODW6ncDt/image.png" alt=""><figcaption></figcaption></figure>
14. Click **Create Database**.

### Create OvalEdge Schema

Once the RDS instance is available:

1. Copy the **endpoint** from the RDS dashboard.<br>

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/49fhJeu9RqMVsYzk5be9/image.png" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/pZmqJiMUUiCgPUTUMScV/image.png" alt=""><figcaption></figcaption></figure>
2. Connect to the instance using a database client (e.g., MySQL CLI):

   ```bash
   mysql -h <rds-endpoint> -u <username> -p
   ```

## Download and Execute OvalEdge DB Scripts

1. Ensure the **OvalEdge DB scripts** are available on the EC2 instance (typically located under `$HOME/ovaledge/`).
2. Connect to the RDS instance using MySQL CLI:<br>

   ```bash
   mysql -h <rds-endpoint> -u <username> -p
   ```

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/OCqq11yd42aD8ZPDJRID/image.png" alt=""><figcaption></figcaption></figure>
3. After logging in, execute the **master script**:<br>

   ```bash
   source /home/ec2-user/ovaledge/MasterScripts.sql;
   ```

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/U9skFktC3pGM5f3M234Y/image.png" alt=""><figcaption></figcaption></figure>
4. Verify schema creation:

   ```sql
   show databases;
   ```

   The database **`ovaledgedb`** should be listed, confirming successful script execution.<br>

   <figure><img src="https://content.gitbook.com/content/ztcvwwOJCeaE1n6oHp4C/blobs/Ij8eAg21DxM7HV1mrxjE/image.png" alt=""><figcaption></figcaption></figure>

***

Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.
