A Few Reasons to Switch to PostgreSQL 9.0

DZone 's Guide to

A Few Reasons to Switch to PostgreSQL 9.0

· Database Zone ·
Free Resource
PostgreSQL is widely considered to be the main open source competitor to MySQL.  It's been five years since the release of PostgreSQL 8.0, but this week, PostgreSQL developers showed that their project has evolved significantly in that time.  The beta release of PostgreSQL 9.0 has burst onto the scene with handsome new features such as Hot Standby and Streaming Replication, which are making it even more lucrative to switch from MySQL to PostgreSQL.

1. Hot Standby

This feature allows connection to a server that is in archive recovery mode. Users with a server in recovery mode can still process read-only queries and move to normal operations without disconnecting.  There are only a few usage and administrative differences when a server is running queries in recovery mode.  Hot Standby greatly improves tasks such as log shipping replication and precise restoration of a backup state.  

2. Streaming Replication

Streaming replication allows a standby server to connect to the primary server and receive a stream of WAL (Write Ahead Log) records as they are generated, instead of having to wait for those records to be written to disk and picked up later.  This allows the standby to be more up to date than it is with file-based log shipping.  The streaming replication is asynchronous, so there's a slight delay between committing a transaction in the primary and seeing it in the standby, but it's much shorter than with file-based shipping.  archive-timeout is no longer required to reduce the data loss window thanks to streaming replication.  

3. A Few Other Features

The LISTEN/NOTIFY events in PostgreSQL 9.0 have been moved from a system table to a memory queue for better performance.  NOTIFY is now able to pass an optional string to listeners.  PostgreSQL 9.0 also includes SQL compliant per-column triggers and anonymous functions using the DO statement.  Server side language support has been enhanced as well.
EXCLUDE can now be used in the CREATE TABLE statement as a non-traditional constraint. In the documentation you can find an example of how EXCLUDE can ensure that no two records contain overlapping circles.

4. More in Store

Where a project is going is just as important (if not more important) than where it currently is, if you're considering migration to that project.  A blog from Robert Haas indicates that the PostgreSQL project will continue adding features that distinguish it from competitors.  There are several big patches planned for versions 9.1, 9.2, and beyond.  KNNGIST will allow the use of indices to accelerate ORDER BY queries.  Partitioning support will be improved with built-in syntax to reduce the amount of manual setup required.  Another feature will be index-only scans, which reduce I/O for index scans by intelligently skipping or delaying tuple visibility checks.
The PostgreSQL developers originate from several major open source companies including Red Hat, F-Secure, and EnterpriseDB (a commercialization of PostgreSQL). PostgreSQL is released under the PostgreSQL License, which is a liberal license that's similar to the BSD or MIT licenses.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}