Azure Database for PostgreSQL Documentation
Welcome to the comprehensive documentation for Azure Database for PostgreSQL. This managed database service provides users with reliable PostgreSQL database capabilities on the Azure cloud.
Introduction
Azure Database for PostgreSQL is a relational database service based on the open-source PostgreSQL database engine. It allows you to focus on application development and data management without the need to manage infrastructure. The service handles patching, backups, high availability, and protection against threats automatically.
Key Features
- Scalability: Scale your database up or down based on your application's needs.
- High Availability: Built-in redundancy and failover mechanisms ensure your database is always available.
- Security: Comprehensive security features including data encryption at rest and in transit, network isolation, and Azure Active Directory integration.
- Performance: Optimized for performance with various compute and storage tiers.
- Managed Backups: Automated backups with configurable retention policies.
- Geo-restore: Recover your database to any Azure region.
- PostgreSQL Compatibility: Supports various PostgreSQL versions, ensuring broad application compatibility.
Getting Started
To get started with Azure Database for PostgreSQL, follow these steps:
- Create an Azure Account: If you don't have one, sign up for a free Azure account.
- Provision a Server: Use the Azure portal, Azure CLI, or Azure PowerShell to create your first PostgreSQL server.
- Connect to Your Server: Configure firewall rules and use your preferred PostgreSQL client or application to connect.
- Create Databases and Tables: Start building your data model.
Deployment Options
Azure Database for PostgreSQL offers three distinct deployment options to suit different application needs:
- Single Server: A fully managed PostgreSQL server for development and production workloads.
- Flexible Server: Provides more granular control over database management, cost optimization, and higher availability. Ideal for cloud-native applications.
- Hyperscale (Citus): A horizontally scalable distributed PostgreSQL database service that allows you to scale out your PostgreSQL database to handle massive datasets and high transaction volumes.
Connectivity
Connecting to your Azure Database for PostgreSQL server is straightforward. You can use:
- Azure Portal: For management and basic client tools.
- psql command-line tool: The standard PostgreSQL client.
- Application drivers: Such as psycopg2 (Python), Npgsql (.NET), etc.
- Azure services: Such as App Service, Azure Functions, and AKS.
Ensure your firewall rules are configured to allow access from your client or application's IP address.
Monitoring and Management
Monitor the performance and health of your PostgreSQL server using Azure Monitor. Key metrics include CPU, memory, storage, I/O, and connections. You can also set up alerts for important events.
Management tasks like scaling, backup configuration, and parameter tuning can be performed through the Azure portal or programmatically via Azure CLI/PowerShell.
Security
Security is paramount. Azure Database for PostgreSQL offers:
- Data Encryption: Data is encrypted at rest using AES 256-bit encryption and in transit via SSL/TLS.
- Network Security: Configure firewall rules and virtual network service endpoints for private access.
- Authentication: Supports PostgreSQL native authentication and Azure Active Directory authentication.
- Auditing: Log database activities for compliance and security analysis.
Pricing
Pricing for Azure Database for PostgreSQL varies based on the deployment option (Single Server, Flexible Server, Hyperscale), compute tier, vCores, storage, and data transfer. Visit the Azure PostgreSQL pricing page for detailed information.
Explore the following sections for more in-depth information: