1# SWI-Prolog package paxos 2 3This package provides the library `paxos.pl` that implements a 4replicating key-value store of Prolog terms on top of SWI-Prolog 5`broadcast` libraries and its TIPC or UDP based extension that 6allow broadcasting outside the process using networking. 7 8## Features and usage 9 10This library allows a cluster of Prolog processes that can communicate 11using TIPC or UDP to maintain a replicated key-value store. Both keys 12and values are arbitrary ground Prolog terms. Nodes may be dynamically 13added and removed from the cluster while the cluster maintains a shared 14view of the available nodes and their status. The library uses the 15_paxos_ algorithm to guarantee consistency and progress in the context 16of appearing and failing nodes as well as networking that may drop 17packages, have packages arrive out-of-order or be duplicated. 18 19Changes to key values are available as reliable _broadcast_ events in 20the participating nodes. 21 22## Application areas 23 24This package has been primarily developed to support clustered HTTP 25servers that need to share status information such as _session cookies_. 26 27## Dependencies 28 29This package requires either the TIPC or `clib` package to provide 30network enabled broadcasting. 31 32## Status 33 34The current implementation is incomplete and has barely been tested. 35 36## Plans 37 38 - Complete and test the implementation 39 - Make the storage _hookable_ and provide scalable backends based 40 on e.g. RocksDB. 41 - The current version only support the _quorum_. There is only 42 partial support for _learners_ that follow the _quorum_, but 43 do not participate in voting. 44 45 46## History 47 48This library was originally conceived by Jeffrey Rosenwald as 49`tipc_paxos.pl` as part of the [TIPC 50package](https://github.com/SWI-Prolog/contrib-tipc). Jeffrey later 51implemented `udp_broadcast.pl` as an alternative network enabled 52broadcast transport that could be used for `tipc_paxos.pl`. Jan 53Wielemaker renamed the library to `paxos.pl` and added hooks to work 54with both the TIPC and UDP (and potentially other) transport mechanisms. 55 56As the project grows more complicated and both requires support 57libraries and a testing framework it has been moved to be an extension 58package of SWI-Prolog. 59