A ruby library for accessing memcachedb: memcachedb.org/
Source: github.com/juggy/memcachedb-client
To install the gem
With a single server: CACHE = MemCacheDb.new :servers=>‘localhost:11211’ With multiple master servers CACHE = MemCacheDb.new [{:servers=>‘host1:11211’, :name=>‘host1’}, {:servers=>‘host2:11211’, :name=>‘host2’}] With a single master-slave configuration
CACHE = MemCacheDb.new :servers=>[‘localhost:11211’, ‘localhost:11212’] With multiple master-slave configuration CACHE = MemCacheDb.new [{:servers=>[‘host1:11211’, ‘host1:11212’], :name=>‘host1’}, {:servers=>[‘host2:11211’, ‘host2:11212’], :name=>‘host2’}]
* The master will be determined automatically
memcachedb -p11211 -r -H ./memcache1 -N -R 127.0.0.1:21211 -O 127.0.0.1:31211 -p11211 : the memcache port the server will listen to -R 127.0.0.1:21211 : the port the replication server will listen to for this instance -O 127.0.0.1:31211 : each other replication server in the master-slave group -The master will be elected once all servers are started.
- julien.guimont@gmail.com
memcache-client Documentation
A ruby library for accessing memcached.
Source:
github.com/mperham/memcache-client
Just install the gem:
$ sudo gem install memcache-client
With one server:
CACHE = MemCache.new 'localhost:11211'
Or with multiple servers:
CACHE = MemCache.new %w[one.example.com:11211 two.example.com:11211]
The MemCache.new method takes a number of options which can be useful at times. Please read the source comments there for an overview. If you are using Ruby 1.8.x and using multiple memcached servers, you should install the RubyInline gem for ultimate performance.
Rails 2.1+ includes memcache-client 1.5.0 out of the box. See ActiveSupport::Cache::MemCacheStore and the Rails.cache method for more details. Rails 2.3+ will use the latest memcache-client gem installed.
memcache-client is maintained by Mike Perham and was originally written by Bob Cottrell, Eric Hodel and the seattle.rb crew.
- WWW
If my work on memcache-client is something you support, please take a moment to recommend me at WWR. I’m not asking for money, just a electronic “thumbs up”.