Localmemcache is a library for C and ruby that aims to provide an interface similar to memcached but for accessing local data instead of remote data. It's based on mmap()'ed shared memory for maximum speed. Since version 0.3.0 it supports persistence, also making it a fast alternative to GDBM and Berkeley DB.
Gemfile gem 'localmemcache', '~> 0.4.1'
install gem install localmemcache -v 0.4.1