Metadata-Version: 1.1
Name: pysyncobj
Version: 0.2.2
Summary: A library for replicating your python class between multiple servers, based on raft protocol
Home-page: https://github.com/bakwc/PySyncObj
Author: Filipp Ozinov
Author-email: fippo@mail.ru
License: UNKNOWN
Download-URL: https://github.com/bakwc/PySyncObj/tarball/0.2.2
Description: PySyncObj
        =========
        
        |Build Status| |Coverage Status| |Release| |License| |gitter|
        
        PySyncObj is a python library that provides ability to sync your data
        between multiple servers. - It use `raft
        protocol <http://raft.github.io/>`__ for leader election and log
        replication. - It supports log compaction. It use fork for copy-on-write
        while serializing data on disk. - It supports `dynamic membership
        changes <https://github.com/bakwc/PySyncObj/wiki/Dynamic-membership-change>`__
        (cluster reconfiguration). - It supports in-memory and on-disk
        serialization. You can use in-memory mode for small data and on-disk for
        big one. - It has encryption - you can set password and use it in
        external network. - It supports python2 and python3 on linux, macos and
        windows. No dependencies required (only optional one, eg. cryptography).
        - Configurable event loop - it can works in separate thread with it's
        own event loop - or you can call onTick function inside your own one. -
        Convenient interface - you can easily transform arbitrary class into a
        replicated one (see example below).
        
        Content
        -------
        
        1. `Install <#install>`__
        2. `Usage <#usage>`__
        3. `Performance <#performance>`__
        
        Install
        -------
        
        PySyncObj itself:
        
        .. code:: bash
        
            pip install pysyncobj
        
        Cryptography for encryption (optional):
        
        .. code:: bash
        
            pip install cryptography
        
        Usage
        -----
        
        Consider you have a class that implements counter:
        
        .. code:: python
        
            class MyCounter(object):
                def __init__(self):
                    self.__counter = 0
        
                def incCounter(self):
                    self.__counter += 1
        
                def getCounter(self):
                    return self.__counter
        
        So, to transform your class into a replicated one: - Inherit it from
        SyncObj - Initialize SyncObj with a self address and a list of partner
        addresses. Eg. if you have ``serverA``, ``serverB`` and ``serverC`` and
        want to use 4321 port, you should use self address ``serverA:4321`` with
        partners ``[serverB:4321, serverC:4321]`` for your application, running
        at ``serverA``; self address ``serverB:4321`` with partners
        ``[serverA:4321, serverC:4321]`` for your application at ``serverB``;
        self address ``serverC:4321`` with partners
        ``[serverA:4321, serverB:4321]`` for app at ``serverC``. - Mark all your
        methods that modifies your class fields with ``@replicated`` decorator.
        So your final class will looks like:
        
        .. code:: python
        
            class MyCounter(SyncObj):
                def __init__(self):
                    super(MyCounter, self).__init__('serverA:4321', ['serverB:4321', 'serverC:4321'])
                    self.__counter = 0
        
                @replicated
                def incCounter(self):
                    self.__counter += 1
        
                def getCounter(self):
                    return self.__counter
        
        And thats all! Now you can call ``incCounter`` on ``serverA``, and check
        counter value on ``serverB`` - they will be synchronized. You can look
        at examples and syncobj\_ut.py for more use-cases.
        
        Performance
        -----------
        
        |15K rps on 3 nodes; 14K rps on 7 nodes;| |22K rps on 10 byte requests;
        5K rps on 20Kb requests;|
        
        .. |Build Status| image:: https://travis-ci.org/bakwc/PySyncObj.svg?branch=master
           :target: https://travis-ci.org/bakwc/PySyncObj
        .. |Coverage Status| image:: https://coveralls.io/repos/github/bakwc/PySyncObj/badge.svg?branch=master
           :target: https://coveralls.io/github/bakwc/PySyncObj?branch=master
        .. |Release| image:: https://img.shields.io/badge/release-0.2.2-blue.svg?style=flat
           :target: https://github.com/bakwc/PySyncObj/releases
        .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat
           :target: LICENSE.txt
        .. |gitter| image:: https://badges.gitter.im/bakwc/PySyncObj.svg
           :target: https://gitter.im/bakwc/PySyncObj?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
        .. |15K rps on 3 nodes; 14K rps on 7 nodes;| image:: http://pastexen.com/i/Ge3lnrM1OY.png
        .. |22K rps on 10 byte requests; 5K rps on 20Kb requests;| image:: http://pastexen.com/i/0RIsrKxJsV.png
        
        
Keywords: network,replication,raft,synchronization
Platform: UNKNOWN
Classifier: Topic :: System :: Networking
Classifier: Topic :: System :: Distributed Computing
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: License :: OSI Approved :: MIT License
