Skip to content
Generic Queue and Replication for PostgreSQL
Python PLpgSQL C Shell Other
Latest commit 11afc52 Feb 21, 2016 @markokr Merge pull request #51 from olshevskiy87/typos
fix typos
Failed to load latest commit information.
debian v3.2.6 Nov 5, 2014
doc fix typos Feb 20, 2016
lib @ 2c1cb7f Upgrade libusual to master, rewrite pgqd Makefile Apr 10, 2014
old Get rid of dictfetch*() usage, it's obsolete. Sep 18, 2013
python fix typos Feb 20, 2016
scripts moved log msg about script's normal shutdown from BaseScript to DataM… Oct 27, 2014
tests tests/londiste/ test various combination of options Mar 22, 2013
upgrade fix typos Feb 20, 2016
.gitignore .gitignore updated Oct 3, 2013
COPYRIGHT Apply ISC license clarification Apr 8, 2009
INSTALL v3.1.5 Aug 9, 2013
Makefile make debclean: make it less broken Feb 20, 2013
NEWS v3.2.6 Nov 5, 2014
README fix typos Feb 20, 2016 Refresh libusual, provide ./ Dec 22, 2011 add more replacement vars. Dec 29, 2011 v3.2.6 Nov 5, 2014 Update setup*.py to point to correct license. Apr 2, 2014 Merge commit 'bbcd65e4e74e705e0cc07a549bda73e37e20012a' into hotfix/3… Apr 9, 2014


= SkyTools - tools for PostgreSQL =

This is a package of tools in use in Skype for replication and failover.
It also includes a generic queuing mechanism called PgQ and a utility
library for Python scripts, as well as a script for setting up and
managing WAL based standby servers.

== Overview ==

It contains the following modules:

=== PgQ ===

PgQ is a queuing system written in PL/pgSQL, Python and C code. It is
based on snapshot-based event handling ideas from Slony-I, and is
written for general usage.

PgQ provides an efficient, transactional, queueing system with
multi-node support (including work sharing and splitting, failover and
switchover, for queues and for consumers).


- There can be several queues in a database.
- There can be several producers than can insert into any queue.
- There can be several consumers on one queue.
- There can be several subconsumers on a consumer.

PgQ is split into 3 layers: Producers, Ticker and Consumers.

*Producers* and *Consumers* respectively push and read events into a
queue. Producers just need to call PostgreSQL stored procedures (like a
trigger on a table or a PostgreSQL call from the application).
Consumers are frequently written in Python (the preferred language as it
has a powerful Skytools Framework), but are not limited to Python; any
language able to run PostgreSQL stored procedures can be used.

*Ticker* is a daemon which splits the queues into batchs of events and
handle the maintenance of the system. The Ticker is provided with


- PgQ ticker daemon (pgqd) usage: link:doc/pgqd.html[]
- PgQ admin tool (qadm) usage: link:doc/qadmin.html[]
- PgQ SQL API overview: link:doc/pgq-sql.html[]
- PgQ SQL reference: link:pgq/[]

=== Londiste ===

Replication tool written in Python, using PgQ as event transport.


- Tables can be added one-by-one into set.
- Initial COPY for one table does not block event replay for other tables.
- Can compare tables on both sides.


- Londiste script usage: doc/londiste3.txt
  (also available as `man 1 londiste`)

- Londiste HOWTOs: doc/howto/

=== walmgr ===

This script will setup WAL archiving, does the initial backup, and
runtime WAL archive and restore.

It can also be used for up-to-last-second partial file copying,
so that less than the whole file is lost in case of loss of the master
database server.

== Source tree contents ==

    Documentation in AsciiDoc format.  Source for both html and man pages.

    Python modules and primary executables - walmgr, londiste, qadmin, pgqadm.

    Python framework for PgQ.

    Londiste replication.

    Low-level utilities for writing database scripts in Python.

    Database modules.

    Table definitions and functions for PgQ queueing.

    Framework for cascaded consuming.

    Functions for cooperative consuming.

    Table definitions and functions for Londiste replication.

    PgQ ticker written in C.

    Python scripts with lesser priority.

    libusual C library, for pgqd.

    Debian packaging.  This is for creating private packages,
    official Debian packages use their own packaging code.

    Random scripts used for building.

== Upgrade from 2.1 ==

Assuming PgQ + Londiste setup.  This will upgrade PgQ to 3.0 and install
Londiste 3 in parallel with Londiste 2.

1. Install Postgres modules.  They are backwards compatible with 2.1.
2. Stop ` ticker` processes.
3. Apply pgq.upgrade_2.1_to_3.0.sql
3. Apply pgq.upgrade.sql
4. Apply pgq_node.sql
5. Apply londiste.sql - this will throw error on CREATE SCHEMA, but should otherwise apply fine.
6. Start pgqd.

The files mentioned above are installed under $PREFIX/share/skytools3/ directory.
Something went wrong with that request. Please try again.