Skip to main content

A hash table (Python dict compatible) that stores data in remote servers. Performance is optimized by using write-back cache.

Project description

About MivRHash

MivRHash (Million-value Remote Hash) is a remote hash table data structure which provides the compatible interface with the Python dict’s interface. It stores hash table data in remote server. Therefore, it is useful when your application uses so many big hash tables (dict objects) that memory in one machine is not sufficient (in other words, you can utilize main memory in multiple hosts in your application). It is originally created for storing inverted indexes of a search engine.

MivRHash allows you to specify the destination of the host where it will store data into. On the remote host, you need to run mivrhashservice to listen to hash operation requests from the client.

Since MivRHash provides the same interface with Python’s dict, adapting your application with MivRHash is very easy. It requires you to change only a line of code (e.g., the hash table initialization statement) to make your application a distributed one.

MivRHash optimized its performance by using write-back cache. You can specify the cache-size when you initialize the remote hash object. The default cache size is 1000 items.

Example

On the server (i.e., the machine that will store hash data), run the service:

$ python -m mivrhash.mivrhashservice  (or python mivrhashservice.py)
Server listening on port 10080

On the client, write code like this:

from mivrhash.mivrhashclient import MivRHash
h1 = MivRHash( "server_address", 10080 )
h1['hello'] = 'world'
h1[5] = 6
h1[ ( 'some', 'tuple' ) ] = 'hello'
h1[ 'aHash' ] = { 1 : 2, 3 : 4 }
h2 = h1[ 'aHash' ]
h2[1] = 5
# Now you need to explicitly assign h2 to h1['aHash']
# because h1 does not automatically recognize the change on its items
print h1['aHash']   # { 1 : 2, 3 : 4 }
h1['aHash'] = h2
print h1['aHash']   # { 1 : 5, 3 : 4 }
for k in h1.iterkeys():
    print k
h1.clear()
h1.close()  # free memory on remote server and disconnect
h1 = None   # this also free memory and disconnect

Installation

MivRHash is designed for very easy installation. It is a pure Python package. You can just copy the whole folder mivrhash into your site-packages directory (e.g., /usr/lib/python2.6/site-packages or C:/Python2.6/Lib/site-packages). The setup script is also available:

$python setup.py install

It requires no additional dependencies to be installed because it depends only on packages that are in Python standard library (such as cPickle and urllib).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

mivrhash-1.0.1.zip (11.2 kB view details)

Uploaded Source

mivrhash-1.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mivrhash-1.0.1.win32.exe (208.8 kB view details)

Uploaded Source

File details

Details for the file mivrhash-1.0.1.zip.

File metadata

  • Download URL: mivrhash-1.0.1.zip
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mivrhash-1.0.1.zip
Algorithm Hash digest
SHA256 0ac4dec75b3e8df97163823f1c54ccb0301a266bb1cdf754335dc28d7c8d0073
MD5 38d2d1b1aa52c6b49b4991b70d6082d0
BLAKE2b-256 8d90905dcf286f68bb0267fad63ab82c89511d3eccb1f793ab77a6505b34056f

See more details on using hashes here.

File details

Details for the file mivrhash-1.0.1.tar.gz.

File metadata

  • Download URL: mivrhash-1.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mivrhash-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9c18f6a10978665254eedeeaef0e8bf180c3daab5953d23c0539696b9e907ebe
MD5 5fcca65413bdbbeaa967150812e2f466
BLAKE2b-256 f7ee05526a7c29c7159e020a080219185c1395f28c5e9cdee8fa5a6b6fcc46f5

See more details on using hashes here.

File details

Details for the file mivrhash-1.0.1.win32.exe.

File metadata

  • Download URL: mivrhash-1.0.1.win32.exe
  • Upload date:
  • Size: 208.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mivrhash-1.0.1.win32.exe
Algorithm Hash digest
SHA256 f8efeb5694fabc6775c48cf032bffe22bdcd3e5ceee95b2b38f9af53c259cfd2
MD5 3b5d29566e7f176d37094268d23dbe7f
BLAKE2b-256 f9b33ce738f09799e77777ef294a6e07cab9f46599bb5d39ba6f54d1cfc4a643

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page