Changes between Version 1 and Version 2 of SynchronisationImplementation


Ignore:
Timestamp:
08/19/09 15:45:56 (16 years ago)
Author:
Fran Boon
Comment:

More cleanup

Legend:

Unmodified
Added
Removed
Modified
  • SynchronisationImplementation

    v1 v2  
    33== Evaluators guide ==
    44=== Current Status ===
     5 * All webservices are implemented. They can be consumed using JSON and JSON-RPC.
     6 * Daemon which automates synchronization is functional though its status can not be confirmed without testing Zeroconf with it.
    57
    6 All webservices are implemented. They can be consumed using JSON and JSON-RPC.
    7 
    8 Daemon which automates synchronization is functional though its status can not be confirmed without testing Zeroconf with it.
    9 
    10 == To Do ==
    11  * Daemon as cronjob is not initialized automatically. see [http://groups.google.com/group/web2py/browse_thread/thread/b8a55655c7a651b8/910af539915e3c9d?lnk=gst&q=hasanatkazmi]
    12  * Zeroconf doesn't seems to be very promising. Extensive testing should be done.[[BR]]
    13  * Automatic Synchronization is limited to Sahanapy. SahanaPHP port should be implemented.[[BR]]
     8== !ToDo ==
     9 * Daemon as cronjob is not initialized automatically: [http://groups.google.com/group/web2py/browse_thread/thread/b8a55655c7a651b8/910af539915e3c9d]
     10 * Zeroconf doesn't seems to be very promising. Extensive testing should be done.
     11 * Automatic Synchronization is limited to !SahanaPy. SahanaPHP port should be implemented.
    1412
    1513== Evaluation Guide ==
    1614
    17 0. Install python 2.5 or 2.6[[BR]]
    18 1. Install json-rpc from [http://json-rpc.org/wiki/python-json-rpc][[BR]]
    19 2. Install Bazaar[[BR]]
    20 3. bzr branch lp:~mdipierro/web2py/devel web2py[[BR]]
    21 4. cd web2py/applications[[BR]]
    22 5. bzr branch lp:~hasanatkazmi/sahana/p2psync[[BR]]
    23 6. cd p2psync/cron[[BR]]
    24 7. start web2py[[BR]]
    25 8  start daemonX (python deamonX.py)[[BR]]
    26 9. Replicate same procedure on another machine[[BR]]
    27 10. Synchronization module should list other server in Sync Partners. After sometime, synchronization history should list sync activity. Logs are also maintained in cron/synclog.[[BR]]
     15 0. Install python 2.5 or 2.6 (2.6 passes all json-rpc tests, whilst 2.5 fails a couple)
     16 1. Install json-rpc from [http://json-rpc.org/wiki/python-json-rpc]
     17 2. Install Bazaar
     18 3. {{{bzr branch lp:~mdipierro/web2py/devel web2py}}}
     19 4. {{{cd web2py/applications}}}
     20 5. {{{bzr branch lp:~hasanatkazmi/sahana/p2psync}}}
     21 6. {{{cd p2psync/cron}}}
     22 7. start web2py
     23 8  start daemonX: {{{python daemonX.py}}}
     24 9. Replicate same procedure on another machine
     25 10. Synchronization module should list other server in Administration | Synchronisation | Sync Partners. After sometime, synchronization history should list sync activity. Logs are also maintained in {{cron/synclogs}}}.
    2826
    2927== WEB SERVICES API ==
    30 
    31 (This API is also used by daemonX which drives automatic p2p syncing between clients)
     28This API is used by daemonX which drives the automatic p2p syncing between clients
    3229
    3330=== Supported web services ===
     
    3532 * JSON-RPC
    3633
    37 === ToDo (partial work has been done) ===
     34=== !ToDo (partial work has been done) ===
    3835 * XML
    3936 * XML-RPC
    4037
    41 '''Service Proxy''':
     38=== Service Proxy ===
    4239        JSON: http://localhost:8000/sahana/admin/call/json
    4340                e.g. http://localhost:8000/sahana/admin/call/json/getdata?timestamp=0&.........
     
    4643
    4744=== Available functions ===
    48 '''putdata(uuid, username, password, nicedbdump):'''
     45==== putdata(uuid, username, password, nicedbdump) ====
    4946        This function is used to insert data in the system.
    5047        args:
     
    9289
    9390
    94 '''getdata(uuid, username, password, timestamp = None):'''
     91==== getdata(uuid, username, password, timestamp = None) ====
    9592        returns data as nicedbdump defined in putdata. Data after timestamp time will returned, if None is passes as timestamp, then that data which has been added to the system after last getdata call from uuid will be returned.
    9693        Args:
     
    106103
    107104=== Example code ===
     105Note: This example is in Python, but you can write a client in any language of your choice.
    108106{{{
    109107from jsonrpc import ServiceProxy, JSONRPCException
     
    130128}}}
    131129
    132 Note: This example is in Python, but you can write a client in any language of your choice.
    133 
    134130=== Choosing !ZeroConf for Network discovery ===
    135131Automatic synchronization between servers require automatic service discovery. We had two major options to choose from:
    136 1) ZeroConf
    137 2) Mesh4x
     132 1. ZeroConf
     133 2. Mesh4x
    138134
    139135!ZeroConf & Mesh4x solve different problems. They don't overlap in functionality at all:
     
    142138
    143139We were more interested in Zeroconf because:
    144 1) !ZeroConf has Python library but Mesh4x doesn't. I means double work was required if we go with Mesh4x.
    145 2) We just needed automatic discovery of service because we wanted to use web services, so that foreign developers can also use Restful API
    146 3) Mesh4x required java daemon, which meant adding jre in the package which would double Sahana package size.
    147 
    148 
    149 
     140 1. !ZeroConf has Python library but Mesh4x doesn't. I means double work was required if we go with Mesh4x.
     141 2. We just needed automatic discovery of service because we wanted to use web services, so that foreign developers can also use Restful API
     142 3. Mesh4x required java daemon, which meant adding jre in the package which would double Sahana package size.
    150143
    151144=== daemonX: Daemon which runs automatic synchronization ===