Skip to content

Commit cc023be

Browse files
committed
new guides
1 parent 794fea1 commit cc023be

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

articles/postgresql/flexible-server/concepts-connection-pooling-best-practices.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Connection Pooling Best Practices - Azure Database for PostgreSQL - Flexible Server
2+
title: Connection pooling best practices - Azure Database for PostgreSQL - Flexible Server
33
description: This article describes the best practices for connection pooling in Azure Database for PostgreSQL - Flexible Server.
44
ms.service: postgresql
55
ms.subservice: flexible-server
@@ -9,7 +9,7 @@ author: raiy
99
ms.date: 08/30/2023
1010
---
1111

12-
# Connection Pooling Strategy for PostgreSQL Using PgBouncer
12+
# Connection pooling strategy for PostgreSQL Using PgBouncer
1313

1414
[!INCLUDE [applies-to-postgresql-flexible-server](../includes/applies-to-postgresql-flexible-server.md)]
1515

@@ -21,7 +21,7 @@ When using PostgreSQL, establishing a connection to the database involves creati
2121

2222
To mitigate this issue, connection pooling is used to create a cache of connections that can be reused in PostgreSQL. When an application or client requests a connection, it's created from the connection pool. After the session or transaction is completed, the connection is returned to the pool for reuse. By reusing connections, resources usage is reduced, and performance is improved.
2323

24-
:::image type="content" source="./media/concepts-connection-pooling-best-practices/connection-patterns.png" alt-text="Diagram for Connection Pooling Patterns":::
24+
:::image type="content" source="./media/concepts-connection-pooling-best-practices/connection-patterns.png" alt-text="Diagram for Connection Pooling Patterns.":::
2525

2626
Although there are different tools for connection pooling, in this section, we discuss different strategies to use connection pooling using **PgBouncer**.
2727

@@ -35,22 +35,22 @@ Although there are different tools for connection pooling, in this section, we d
3535

3636
The effective utilization of PgBouncer can be categorized into three distinct usage patterns.
3737

38-
1. PgBouncer and Application Colocation deployment
39-
1. Application independent centralized PgBouncer deployments
40-
1. Inbuilt PgBouncer and Database deployment
38+
- **PgBouncer and Application Colocation deployment**
39+
- **Application independent centralized PgBouncer deployments**
40+
- **Inbuilt PgBouncer and Database deployment**
4141

4242

4343
Each of these patterns has its own advantages & disadvantages.
4444

45-
## 1. PgBouncer and Application Colocation Deployment
45+
## 1. PgBouncer and application colocation Deployment
4646

4747
When utilizing this approach, PgBouncer is deployed on the same server where your application is hosted. The application & PgBouncer can be deployed either on traditional virtual machines or within a microservices-based architecture as highlighted:
4848

4949
### I. PgBouncer deployed in Application VM
5050

5151
If your application runs on an Azure VM, you can set up PgBouncer on the same VM. To install and configure PgBouncer as a connection pooling proxy with Azure Database for PostgreSQL, follow the instructions provided in the following [link](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/steps-to-install-and-setup-pgbouncer-connection-pooling-proxy/ba-p/730555).
5252

53-
:::image type="content" source="./media/concepts-connection-pooling-best-practices/co-location.png" alt-text="Diagram for App co-location on VM":::
53+
:::image type="content" source="./media/concepts-connection-pooling-best-practices/co-location.png" alt-text="Diagram for App co-location on VM.":::
5454

5555

5656
Deploying PgBouncer in an application server can provide several advantages, especially when working with PostgreSQL databases. Some of the key benefits & limitations of this deployment method are:
@@ -82,7 +82,7 @@ Microsoft has published a [**PgBouncer** sidecar proxy image](https://hub.docker
8282

8383
Refer [this](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/steps-to-install-and-setup-pgbouncer-connection-pooling-on-azure/ba-p/3633043) for more details.
8484

85-
:::image type="content" source="./media/concepts-connection-pooling-best-practices/sidecar-proxy.png" alt-text="Diagram for App co-location on Sidecar":::
85+
:::image type="content" source="./media/concepts-connection-pooling-best-practices/sidecar-proxy.png" alt-text="Diagram for App co-location on Sidecar.":::
8686

8787
Some of the key benefits & limitations of this deployment method are:
8888

@@ -102,7 +102,7 @@ By considering PgBouncer as an AKS sidecar, you can use these advantages to enha
102102

103103
While considering this sidecar pattern, it's crucial to carefully assess the trade-offs between deployment complexity and scalability requirements to determine the most appropriate approach for your specific application scenario.
104104

105-
## 2. Application Independent - Centralized PgBouncer Deployment
105+
## 2. Application independent - centralized PgBouncer deployment
106106

107107
When utilizing this approach, PgBouncer is deployed as a centralized service, independent of the application. The PgBouncer service can be deployed either on traditional virtual machines or within a microservices-based architecture as highlighted:
108108

@@ -113,7 +113,7 @@ When utilizing this approach, PgBouncer is deployed as a centralized service, in
113113
Refer [link](https://techcommunity.microsoft.com/t5/azure-database-for-postgresql/steps-to-install-and-setup-pgbouncer-connection-pooling-proxy/ba-p/730555) to install and set up PgBouncer connection pooling proxy with Azure Database for PostgreSQL.
114114

115115

116-
:::image type="content" source="./media/concepts-connection-pooling-best-practices/deploying-vm.png" alt-text="Diagram for App co-location on Vm with Load Balancer":::
116+
:::image type="content" source="./media/concepts-connection-pooling-best-practices/deploying-vm.png" alt-text="Diagram for App co-location on Vm with Load Balancer.":::
117117

118118
Some of the key benefits & limitations of this deployment method are:
119119

@@ -132,15 +132,15 @@ By considering these benefits, deploying PgBouncer on a VM offers a convenient a
132132
- **Management overhead:** As **PgBouncer** is installed in VM, there might be management overhead to manage multiple configuration files. This makes it difficult to cope up with version upgrades, new releases, and product updates.
133133
- **Feature parity:** If you're migrating from traditional PostgreSQL to Azure PostgreSQL and using **PgBouncer**, there might be some features gaps. For example, lack of md5 support in Azure PostgreSQL.
134134

135-
### II. Centralized PgBouncer Deployed as a service within AKS
135+
### II. Centralized PgBouncer deployed as a service within AKS
136136

137137
If you're working with highly scalable and large containerized deployments on Azure Kubernetes Service (AKS), consisting of hundreds of pods, or in situations where multiple applications need to connect to a shared database, **PgBouncer** can be employed as a standalone service rather than a sidecar container.
138138

139139
By utilizing **PgBouncer** as a separate service, you can efficiently manage and handle connection pooling for your applications on a broader scale. This approach allows for centralizing the connection pooling functionality, enabling multiple applications to connect to the same database resource while maintaining optimal performance and resource utilization.
140140

141141
[**PgBouncer** sidecar proxy image](https://hub.docker.com/_/microsoft-azure-oss-db-tools-pgbouncer-sidecar) published in Microsoft container registry can be used to create and deploy a service.
142142

143-
:::image type="content" source="./media/concepts-connection-pooling-best-practices/centralized-aks.png" alt-text="Diagram for PgBouncer as a service within AKS":::
143+
:::image type="content" source="./media/concepts-connection-pooling-best-practices/centralized-aks.png" alt-text="Diagram for PgBouncer as a service within AKS.":::
144144

145145
Some of the key benefits & limitations of this deployment method are:
146146

0 commit comments

Comments
 (0)