Saltar al contenido principal

AWS PosgreSQL

SleakOps offers seamless integration with Amazon RDS for PostgreSQL, a fully managed relational database service. PostgreSQL is known for its advanced features, scalability, and robust performance, making it a preferred choice for complex applications and data-intensive operations. By integrating PostgreSQL through SleakOps, you can efficiently manage your database deployments and leverage the power of AWS’s managed database service.

FAQs

How does SleakOps manage MySQL credentials?

When you create a MySQL dependency in SleakOps, it automatically generates a Vargroup for your database. This Variable Group securely stores the MySQL credentials and other important configuration details, such as the database endpoint and user access information. You’ll be able of manage them from Vargroups section.

What is Multi-AZ deployment and should I enable it?

Multi-AZ (Availability Zone) deployment ensures high availability and failover support by replicating your database in another availability zone. It’s recommended for production environments to prevent downtime. Keep in mind that it increases costs.

Can I change the PostgreSQL version after the database is deployed?

No, the database engine version cannot be changed after deployment. You would need to create a new PostgreSQL instance with the desired version and migrate your data. Or change it manually into the AWS Console.

What happens if I need more storage for my PostgreSQL database?

You can adjust the storage size when configuring your database. If you need more storage after deployment, SleakOps allows you to scale the storage size without downtime.

How do I create a PostgreSQL database dump?

To create a dump of your PostgreSQL database:

  1. Run the pg_dump Command:
sh
pg_dump -h POSTGRESQL_ADDRESS -U POSTGRESQL_USERNAME -W > dump.sql

Replace POSTGRESQL_ADDRESS, POSTGRESQL_USERNAME, and dump.sql with the appropriate values. 2. Consult Documentation: For more information on how to create a dump, refer to the official PostgreSQL documentation..

How do I import an existent dump using docker?

To import a database dump into your PostgreSQL RDS instance:

  1. Connect to the VPN: Ensure you are connected to the VPN of the AWS account where the RDS instance is located.
  2. Run Docker Container (Recommended):
  • Install Docker on your local machine if not already installed.
  • Run a PostgreSQL Docker container with the following command:
sh
docker run -it --name postgresql-container -v ./initial_data/:/tmp/data/ -e POSTGRESQL_ROOT_PASSWORD=POSTGRESQL_PASSWORD -d postgres bash
  • Attach to the container’s terminal:
sh
docker exec -t -i postgresql-container bash
  • Import the dump file:
pg_dump -h POSTGRESQL_ADDRESS -U POSTGRESQL_USERNAME -W  < /tmp/data/dump.sql

Replace POSTGRESQL_ADDRESS, POSTGRESQL_USERNAME, and dump.sql with your specific details.

How do I import an existent dump to my local machine ?

Alternatively, you can use a PostgreSQL client installed on your local machine to import the dump.

sh
psql -h POSTGRESQL_ADDRESS -U POSTGRESQL_USERNAME -W -f /tmp/data/dump.sql

What should I do if I encounter connection issues with my PostgreSQL database?

Check the following:

  • Ensure the database endpoint, username, and password are correct.
  • Verify that your firewall rules allow access.
  • Ensure the database is running and has enough resources (CPU, memory). Otherwise, contact us.

What is an RDS Read Replica?

An RDS Read Replica is a read-only copy of your primary database instance in Amazon RDS. It helps distribute read-heavy workloads and improves the performance and scalability of your database by offloading read operations from the primary database.
RDS Read Replicas are ideal when you need to:

  • Offload read-heavy operations from your primary instance.
  • Scale your read operations as your application grows.
  • Distribute database reads across multiple geographic locations.
  • Have a backup solution that can quickly be promoted to a primary instance in case of failure.
info

Keep in mind that Read replicas have a delay performing updates.

How do I configure a Read Replica in SleakOps?

In SleakOps, when creating a read replica for your RDS database, you will need to provide the following information:

  • Name of the replica
  • Replica Instance Class, which determines the instance type for the replica.
  • Replica Publicly Accessible, to decide if the replica should have a public IP or be accessible only within your private network.

Can I delete a replica?

At the moment, the only way is to delete the dependency.

info

Set up your PostgreSQL

1. Add PostgreSQL as a Dependency

To integrate MySQL with SleakOps:

  1. In the SleakOps console, go to the "Dependencies" section
  2. Choose "PostgreSQL" from the list of available dependency types. For more detail see Dependencies: Integrating Databases, Caching, and Messaging Services.

2. Set up your PostgreSQL database.

You will access the following form:

postgres-create-p1

Here the parameters that SleakOps allows you to customize during the creation:

AttributeDescription
Database Engine VersionSelect the specific version of the MySQPostgreSQLL database engine you wish to use. This ensures compatibility with your application requirements. Example: PostgreSQL 14.9, PostgreSQL 16.5
Database Instance ClassDefine the instance class that specifies the hardware configuration for your MySQL database. This controls CPU, memory, and network performance. Example: db.m6g.large, db.t3.medium. See AWS detail.
Database StorageSpecify the amount of storage allocated for the database. Example: 100 GB, 500 GB.
UsernameProvide the master username for the MySQL database. This is the main user with administrative privileges. Example: admin, root.
PasswordPassword for the master user to access the database.
Multi-Availability ZoneEnable or disable Multi-AZ deployment. This ensures high availability and failover support by replicating the database across multiple availability zones. Recommended for production environments.
Automated BackupConfigure automated backups for the MySQL database. This ensures data protection by enabling daily snapshots and transaction log backups. Set up the Backup Retention Period and the Backup Window. Recommended for production environments.
Backup Retention PeriodSet the number of days to retain automated backups.
Backup WindowPeriod of time while the backup will be done.
aviso

SleakOps allow the creation of replicas only during the creation of the dependency.

After that basic data, you need to decide if a replica will be created. To do that:

  1. Into the form, look for the section Definition of RDS Read Replicas and click on + Add Item.
  2. Complete the following data:
SettingDescription
NameA name for the replica
Replica Instance ClassDefine the instance class that specifies the hardware configuration for your MySQL database. This controls CPU, memory, and network performance. Example: db.m6g.large, db.t3.medium.
Replica Publicly AccessibleDecide if the replica should have a public IP or be accessible only within your private network.

3. Customize your variable’s name for your MySQL data base.

As explained, when a dependency is created, SleakOps generates a vargroup to hold all the needed attributes. In this step you can change the name of the attributes in case it is needed. SleakOps completes the values automatically. After this step, your dependency is created.

postgres-create-outputs