Book Image

PostgreSQL Replication, Second Edition

Book Image

PostgreSQL Replication, Second Edition

Overview of this book

Table of Contents (22 chapters)
PostgreSQL Replication Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Managing pgq queues


One of the core components of SkyTools is pgq. It provides a generic queuing interface, which allows you to deliver messages from a provider to an arbitrary number of consumers.

The question is: what is the point of a queue in general? A queue has some very nice features. First of all, it will guarantee the delivery of a message. In addition to that, it will make sure that the order in which the messages are put into it is preserved. This is highly important in the case of replication because we must make sure that the messages will not overtake each other.

The idea behind a queue is to be able to send anything from an entity producing the data to any other host participating in the system. This is suitable for replication and for a lot more. You can use pgq as an infrastructure to flexibly dispatch information. Practical examples for this can be shopping cart purchases, bank transfers, or user messages. In this sense, replicating an entire table is more or less a special...