disqus/nydus — pull request #12 by tschellenbach (2012-05-15 13:31:01+00:00)
Title: Prefix based router support

Routes based on the configured prefixes

Example config:

'redis': {
'engine': 'nydus.db.backends.redis.Redis',
'router': 'django_redis.nydus_router.PrefixPartitionRouter',
'hosts': {
'default': {'db': 0, 'host': 'default.redis.goteam.be', 'port': 6379},
'user:loves:': {'db': 1, 'host': 'default.redis.goteam.be', 'port': 6379},
'loves:': {'db': 2, 'host': 'default.redis.goteam.be', 'port': 6379},
'hash:entity:': {'db': 0, 'host': 'entities.redis.goteam.be', 'port': 6379},
}
}

We route to one and only one redis.
Use a seperate config if you want hashing based partitioning.