aeden / moneta forked from wycats/moneta
- Source
- Commits
- Network (24)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Tree:
6cab676
commit 6cab676f6aeebd0737f84790cb626c37992d52dd
tree 4f7e3e5724ed411db3bd9aa2333ba3df6186d2e9
parent a805672808c4bea384c562e85f55c292ab7d7cc8
tree 4f7e3e5724ed411db3bd9aa2333ba3df6186d2e9
parent a805672808c4bea384c562e85f55c292ab7d7cc8
moneta /
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Fri May 08 18:06:07 -0700 2009 | |
| |
LICENSE | Wed Feb 11 22:56:10 -0800 2009 | |
| |
README | Wed Apr 22 18:35:48 -0700 2009 | |
| |
Rakefile | ||
| |
TODO | Wed Feb 11 22:56:10 -0800 2009 | |
| |
benchmarks/ | Fri May 08 21:05:23 -0700 2009 | |
| |
lib/ | ||
| |
moneta.gemspec | ||
| |
script/ | Wed Feb 11 22:56:10 -0800 2009 | |
| |
spec/ | Fri May 08 19:58:48 -0700 2009 |
README
Moneta: A unified interface for key/value stores
================================================
Moneta provides a standard interface for interacting with various kinds of key/value stores.
Out of the box, it supports:
* File store
* Memcache store
* In-memory store
* The xattrs in a file system
* DataMapper
* S3
* Berkeley DB
* Redis
* SDBM
* Tokyo
* CouchDB
All stores support key expiration, but only memcache supports it natively. All other stores
emulate expiration.
The Moneta API is purposely extremely similar to the Hash API. In order so support an
identical API across stores, it does not support iteration or partial matches, but that
might come in a future release.
The API:
#initialize(options):: options differs per-store, and is used to set up the store
#[](key):: retrieve a key. if the key is not available, return nil
#[]=(key, value):: set a value for a key. if the key is already used, clobber it.
keys set using []= will never expire
#delete(key):: delete the key from the store and return the current value
#key?(key):: true if the key exists, false if it does not
#has_key?(key):: alias for key?
#store(key, value, options):: same as []=, but you can supply an :expires_in option,
which will specify a number of seconds before the key
should expire. In order to support the same features
across all stores, only full seconds are supported
#update_key(key, options):: updates an existing key with a new :expires_in option.
if the key has already expired, it will not be updated.
#clear:: clear all keys in this store
