Skip to main content
Aiven for PostgreSQL is a fully managed, high-performance relational database service that offers maximum flexibility with advanced extensions including pgvector for AI-powered search, PostGIS for geospatial queries, and TimescaleDB for time-series data.

Overview

PostgreSQL is a powerful open-source relational database ideal for organizations needing well-structured tabular data storage. Aiven for PostgreSQL provides enterprise-grade reliability, automated operations, and advanced features out of the box.

Why Choose Aiven for PostgreSQL

AI-Powered Search

Built-in pgvector extension for semantic search and similarity matching using vector embeddings

Advanced Extensions

PostGIS for location queries, TimescaleDB for time-series, and 50+ extensions available

High Availability

Multi-node clusters with automatic failover and 99.99% SLA on business plans

Native JSON Support

Store and query nested datasets with native jsonb format for flexible schemas

Key Features

Enable AI-powered similarity search and vector operations:
  • Store ML-generated embeddings directly in PostgreSQL
  • Perform semantic search across text, images, and more
  • Support for exact and approximate nearest neighbor search
  • Index types: IVFFlat and HNSW for performance
Use Cases:
  • Recommendation systems
  • Semantic document search
  • Image similarity detection
  • Fraud detection through pattern matching
Example:
Advanced spatial database capabilities:
  • Store points, lines, polygons, and complex geometries
  • Spatial indexing with GiST and SP-GiST
  • Distance calculations and proximity queries
  • Map projections and coordinate transformations
Example:
Optimized for time-series and IoT data:
  • Automatic partitioning by time
  • Continuous aggregates for real-time rollups
  • Data retention policies
  • Compression for storage efficiency
Example:
Built-in PgBouncer for efficient connection management:
  • Reduce connection overhead
  • Session, transaction, and statement pooling modes
  • Handle thousands of client connections
  • Automatic connection recycling
Multi-region replication for business continuity:
  • Asynchronous replication across regions
  • Failover to secondary region
  • Switchover for planned maintenance
  • RPO (Recovery Point Objective) in seconds

Getting Started

1

Create PostgreSQL Service

Deploy a PostgreSQL service through Aiven Console, CLI, or API:
Choose from multiple service plans:
  • Hobbyist: Single node for development
  • Startup: Single node for small apps
  • Business: High availability with standby
  • Premium: Enhanced HA with 2 standby nodes
2

Enable Extensions

Enable extensions you need for your use case:
3

Create Database and Tables

Set up your database schema:
4

Connect Your Application

Use the connection string from the service overview to connect your application.

Connection Examples

Using SQLAlchemy:

High Availability

Aiven for PostgreSQL provides multiple levels of availability:
1 Primary + 1 Standby Node
  • Synchronous replication to standby
  • Automatic failover in case of primary failure
  • Read replicas for read scaling
  • 14 days backup retention
  • 99.99% SLA
Failure Handling:
  • Primary fails → Standby promoted automatically
  • Standby fails → Primary continues serving
  • Service URI remains constant (only IP changes)

Performance Optimization

Choose the right index type for your queries:
Use EXPLAIN ANALYZE to optimize queries:
Configure PgBouncer for optimal connection management:
  • Session mode: For applications that need session-level features
  • Transaction mode: Best for most web applications
  • Statement mode: Maximum connection reuse
Update via Aiven Console or API:
PostgreSQL automatically tunes shared_buffers based on available memory:
  • Business-4: 1 GB shared_buffers
  • Business-8: 2 GB shared_buffers
  • Business-16: 4 GB shared_buffers
Monitor buffer usage:

Backup and Recovery

Automatic Backups

  • Continuous WAL archiving
  • Point-in-time recovery (PITR)
  • Encrypted backups in object storage
  • Retention: 2-30 days based on plan

Manual Backups

  • On-demand backup creation
  • Fork services from backups
  • Export backups for migration
  • Cross-region backup storage
Restore to Point in Time:
Fork a Service:

Monitoring and Observability

Key Metrics

  • Connections: Active and idle connections
  • Transactions per second: Database throughput
  • Cache hit ratio: Buffer efficiency (target >99%)
  • Query latency: Average query execution time
  • Replication lag: Delay between primary and standby

Integration with Aiven Services

Security Best Practices

  • Use strong passwords for database users
  • Implement least-privilege access control
  • Create separate users for applications
  • Use certificate authentication where possible
  • Rotate credentials regularly
  • Enable VPC peering for private connectivity
  • Use IP allowlisting to restrict access
  • Configure AWS PrivateLink for secure connections
  • Always use SSL/TLS connections
  • Implement application-level encryption for sensitive data
Enable pgaudit for compliance:

Use Cases

Traditional web apps with transactional data:
  • E-commerce platforms
  • Content management systems
  • User authentication and profiles
  • Session storage

Migration to Aiven

1

Prepare Source Database

  • Document current schema and extensions
  • Identify custom configurations
  • Plan for minimal downtime
2

Use aiven-db-migrate

Built-in migration tool for PostgreSQL:
3

Verify Migration

  • Check row counts
  • Verify indexes and constraints
  • Test application connectivity
  • Monitor replication lag
4

Cutover

  • Stop writes to source
  • Wait for replication to complete
  • Update application connection strings
  • Verify application functionality

Apache Kafka

Stream changes with Debezium CDC to Kafka

Apache Flink

Real-time processing with Flink PostgreSQL connector

Grafana

Visualize PostgreSQL data and metrics

OpenSearch

Full-text search with PostgreSQL data

Resources

Migration Support: Aiven provides free migration assistance for Enterprise customers. Contact support for help migrating your PostgreSQL databases.