Redshift vs Postgres (RDS)

When migrating from AWS Postgres (RDS) to AWS Redshift, you'll encounter several significant technical challenges due to the fundamental differences between these database systems:

Architecture Differences

Postgres is an OLTP (Online Transaction Processing) database designed for high-concurrency transactional workloads, while Redshift is an OLAP (Online Analytical Processing) data warehouse optimized for analytical queries and batch processing. This fundamental difference impacts everything from query patterns to data modeling approaches.

Data Type Compatibility

Redshift has a more limited set of data types compared to Postgres. You'll need to handle:

  • JSON/JSONB types aren't natively supported in Redshift (requires VARCHAR and manual parsing)

  • Arrays, geometric types, and network address types don't exist in Redshift

  • Date/time precision differences

  • Custom data types and domains need conversion

  • Text vs VARCHAR(MAX) considerations

SQL Feature Limitations

Redshift lacks many advanced SQL features that Postgres supports:

  • No support for stored procedures (only stored functions with limited capabilities)

  • Limited window function support compared to Postgres

  • No recursive CTEs (Common Table Expressions)

  • No user-defined functions in languages like PL/pgSQL

  • Limited support for complex joins and subqueries in some contexts

  • No foreign key constraints enforcement (you can define them but they're not enforced)

Indexing Strategy Changes

Postgres uses traditional B-tree indexes, while Redshift uses:

  • Sort keys (compound sort keys or interleaved sort keys)

  • Distribution keys for data distribution across nodes

  • No traditional indexes - you must rely on sort keys and distribution strategies

  • This requires completely rethinking your query optimization approach

Transaction and Concurrency Model

Redshift has significant limitations:

  • No support for concurrent writes to the same table

  • Limited transaction isolation levels

  • Slower individual query performance for small, frequent queries

  • Vacuum operations work differently and are more critical for performance

Application Layer Changes

Your application architecture will need adjustments:

  • Connection pooling strategies must change due to Redshift's connection model

  • Query patterns optimized for OLTP won't perform well in OLAP

  • ETL processes may need to be implemented for data loading

  • Real-time data access patterns need redesign

Data Loading and Maintenance

Redshift requires different approaches:

  • COPY command is the preferred method for bulk data loading

  • Incremental updates are more complex

  • Table maintenance (VACUUM, ANALYZE) is crucial and works differently

  • Compression encoding needs to be considered for each column

The migration essentially requires treating it as a complete architectural redesign rather than a simple database swap, as you're moving from a transactional system to an analytical one.

Last updated