An alternative to Tugela cache

Alberto Bertogli albertito at gmail.com
Sun Sep 2 15:12:25 UTC 2007


On Sun, Sep 02, 2007 at 02:31:21AM -0400, Evan Weaver wrote:
> The docs suggest that it's not distributed. Is it?

It has client side distribution.

You can do this:

  db = nmdb.DB()
  db.add_tcp_server('10.0.0.1')
  db.add_tcp_server('10.0.0.2')
  db.add_sctp_server('10.0.0.3')

And then operate the DB as usual. The client will select one of the
servers to send the query to according to the key.

Note that this obviously requires that you use the same servers for all
your clients, or you'll quite likely to get a really weird behaviour.
The order you add them is not important, though.

You can also mix the protocols any way you like, it's completely
independant of that.

I'm also thinking of better hashing schemes to handle different
scenarios (ie. server IPs change frequently, servers can appear and
disappear, and so on) but there is no code yet. Suggestions are more
than welcome.


There is also a "passive mode", used only with TIPC, when you can have
two servers listening to the same port (in TIPC you only deal with
ports, which are cluster-wide), one active and one passive. Both get
and *perform* the requests, but only the active replies.

In that mode, the passives and the active should all have the same database.
There is no handling of server failures (ie. if the active fails, the passives
won't even notice), but you can use that to build some sort of server side
redundancy depending on your needs and your particular situation.

Thanks,
		Alberto


PS: if anyone considers this off topic to the list, I'd be glad to
continue the talk either in private or on the nmdb mailing list (I'd
prefer the later, if possible).




More information about the memcached mailing list