Skip to content

jnovatnack/python-dynamo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

An implementation of dynamo in Python.   A work in progress.

Usage
==============

storage_node.py -p 20050
storage_node.py -p 20051
storage_node.py -p 20052

load_balancer.py -s 127.0.0.1:20050 -s 127.0.0.1:20051 -s 127.0.0.1:20052

In [1]: import xmlrpclib
In [2]: proxy = xmlrpclib.ServerProxy('http://localhost:30000')
In [3]: proxy.put("john", "novatnack")
Out[3]: '200'
In [4]: proxy.put("john", "a later novatnack")
Out[4]: '200'
In [5]: proxy.get("john")
Out[5]: 'a later novatnack'

Two load balancers:

load_balancer.py -s 127.0.0.1:20050 -s 127.0.0.1:20051 -s 127.0.0.1:20052
load_balancer.py -s 127.0.0.1:20050 -s 127.0.0.1:20051 -s 127.0.0.1:20052 -p 30001

Now they can both be queried:

In [17]: proxy = xmlrpclib.ServerProxy('http://localhost:30000')
In [18]: proxy2 = xmlrpclib.ServerProxy('http://localhost:30001')
In [19]: proxy.put('abc', '123')
Out[19]: '200'
In [20]: proxy2.get('abc')
Out[20]: '123'

About

A python implementation of dynamo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages