Is there a built-in keystore for Ruby?

I need a fast and reliable key store for Ruby. Already have something like that?

The requirement is that it be fully executed inside the Ruby process, without the need for any external processes.
It may be in memory with an explicit disk flash.
It should have a minimum search time for keywords, the recording time may not be very good.
The amount of data stored will not be terrible, about several hundred thousand keys, each with a text value of ~ 1kb.

+8
ruby key-value
source share
7 answers

Turns out the best option for me was to use a simple hash along with the marshal to serialize it to disk.
YAML is definitely too slow for so many objects.
Thanks to @ ian-armit for building my trust in the major Ruby libraries.

+3
source share

You can also try Moneta , which allows you to create your own key / value store built into the ruby ​​process.

+4
source share

How is DBM? http://www.ruby-doc.org/stdlib-1.9.3/libdoc/dbm/rdoc/DBM.html

(spambot filler)

The DBM class provides a wrapper for a Unix-style dbm library or database library.

Dbm databases do not have tables or columns; These are simple key-based data stores, such as Ruby Hash, unless they are in RAM. Keys and values ​​must be strings.

+2
source share

You can try Oria: https://github.com/intridea/oria

Oria (oh-rye-uh) is a Ruby-based Key-Value Store with memory. It is designed to handle moderate amounts of data quickly and easily, without causing deployment problems or server headaches. It uses EventMachine to provide a network interface to semi-persistent storage and writes data in memory to YAML files asynchronously.

+1
source share

Check out the PStore . Not sure if he is enough enough.

0
source share

Daybreak is a new new option. The data is stored in a table in memory, so ruby ​​subtleties (each, filter, map, reduction, etc.) are available and, it seems, faster than pstore or dbm.

See this blog post for more details.

0
source share

Here is LevelDB , here are ruby bindings .

0
source share

All Articles