PostgreSQL Hybrid Cloud Deployment Guidelines

Hello, Khabrovites. As part of recruiting a course group “PostgreSQL” prepared a translation of the material for you.

We also invite you to an open demo lesson on the topic “Blocks”… In this lesson, you will learn how locks work; learn to find problem areas in the work of the database. Consider topics: object locks, row locks, memory locks.


Hybrid Cloud is a common architectural design in any company. This concept combines public cloud, private cloud, and even on-premises solutions, giving companies flexibility in where to store and how to use their data. It also helps in implementing a High Availability environment. The problem is that deploying such an environment can be complex and time consuming. In this blog we will see what a hybrid cloud is, some considerations to take into account before using it, and how to deploy this environment using ClusterControl

What is Hybrid Cloud?

It is a topology using a mix of private and public clouds, and even on-premises services. It sounds like a Multi-Cloud environment, but the main difference is that this concept refers to a combination of public and private, in which an on-premises solution can also be used.

Hybrid Cloud Databases Considerations

Moving to a Hybrid Environment is different for each company as they have their own unique set of data, requirements, constraints and processes that go with it.

Let’s take a look at some of the considerations to consider when planning such a topology.

  • Compatibility: Make sure you select a vendor that specializes in your industry and is familiar with the specifics of the requirements that must be met, be it HIPAA, FISMA, PCI, or any other regulation your company subscribes to. Ultimately, your database strategy should be driven by which architecture will best suit your business needs and scale as you grow.

  • Workload: Each database has different workloads. Some of them will work better in a public cloud, others in an on-premises installation, and some in a private cloud. Knowing your workload is essential to finding the optimal mix of your databases.

  • Management and Maintenance: A new environment means a new way to manage and maintain data. Make sure you have the right departments and people to manage these new environments, which must be defined before you make this transition.

How to host PostgreSQL in a hybrid cloud environment

Suppose you are running installing ClusterControl and you’ve already created two different Cloud Provider accounts, or one account if you are using public and private clouds in the same Cloud Provider, or if you are using a combination of Cloud and On-prem environments.

Preparing your cloud environment

First, you need to create your environment in the main cloud provider. In this case we will be using AWS (Amazon Web Services) with 2 nodes PostgreSQL :

Make sure you have SSH (Secure Shell) and PostgreSQL traffic that is allowed from your server ClusterControlby editing the Security Group:

Then go to the next Cloud Provider, or Private or On-prem servers, and create at least one virtual machine to act as a backup node.

Again, make sure you allow SSH and PostgreSQL traffic from your ClusterControl server:

In this case, we allow traffic without any source restrictions, but this is just an example and in real work it is not recommended.

Deploying a PostgreSQL Cluster

Go to the server ClusterControl and select the “Deploy” option. If you already have an instance running PostgreSQLthen you need to select “Import Existing Server / Database”.

When choosing PostgreSQL, you must provide a User, Key, or Password, and a port for SSH connections to your PostgreSQL nodes. You also need the name of your new cluster and if you want, ClusterControl will install and configure the appropriate software for you.

Please see custom ClusterControl requirements for more details on this step.

After configuring SSH access to the information, you must define the database user, version, and data directory (optional). You can also specify which repository to use. In the next step, you need to add your servers to the cluster you are about to create.

When adding your servers, you can enter IP or hostname. In this step, you can also add a node hosted in a secondary cloud (Cloud Provider) or on-premise (on-prem), since ClusterControl does not have any restrictions on network usage, however, for clarity, we will add it in the next section. The only requirement here is the presence SSH access to the node.

In the last step, you can choose whether your replication is Synchronous or Asynchronous.

If you are adding your remote node here, it is important to use asynchronous replication, if not, then your cluster may suffer from delays or network problems.

You can track the status of the creation process in the Activity Monitor ClusterControl

After the task is done, you will be able to see your new cluster PostgreSQL on the main ClusterControl screen.

Adding a Remote Standby Node

After creating a cluster, you can perform several tasks on it, for example, deploy / import a load balancer or replication node.

Go to cluster actions and select “Add Replication Slave”:

Let’s use the “Add new Replication slave” option, since we assume the remote site is a new installation, if not, you can use the “Import existing Replication Slave” option. …

Here you only need to select the Primary server, enter the IP address of your new backup server and the database port. Then you can choose if you want ClusterControl to install the software and whether the replication should be Synchronous or Asynchronous. Again, if you are adding a host elsewhere (another cloud provider or locally installed), you should use asynchronous replication to avoid network performance issues.

This way, you can add as many replicas as you like and distribute read traffic between them using a load balancer, which can also be implemented using ClusterControl.

You can control the creation of the replication node in Activity Monitor ClusterControl

And check your final topology in the Topology View Section.

Conclusion

These functions ClusterControl allow you to quickly set up replication in a hybrid cloud environment, between different cloud providers, or even between a cloud provider and an on-prem database environment PostgreSQL (and other various technologies), as well as manage the settings in a simple and convenient way. Communication between cloud providers or between Private and Public clouds for security reasons should restrict traffic and use only known sources to reduce the risk of unauthorized access to your network.


Learn more about the course “PostgreSQL”

Watch the webinar “Blocks”

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *