Key-value store for Ruby & Java
I need a recommendation for a key-value store. Here's my criteria:
- Doesn't have to be persistent but needs to support lots of records (records are small, 100-1000 bytes)
- Insert (
put
) will happen only occasionally, always in large datasets (bulk) Get
will be random and needs to be fast- Clients will be in Ruby and, perhaps Java
- It should be relatively easy to setup and with as li开发者_开发技巧ttle maintenance needed as possible
Redis sounds like the right thing to use here. It's all in memory so it's very fast (The GET and SET operations are both O(1)) and it supports both Ruby and Java clients.
Aerospike would be a perfect because of below reasons:
- Key Value based with clients available in Java and Ruby.
- Throughput: Better than Redis/Mongo/Couchbase or any other NoSQL solution. See this http://www.aerospike.com/blog/use-1-aerospike-server-not-12-redis-shards/. Have personally seen it work fine with more than 300k read TPS and 100k Write TPS concurrently.
- Automatic and efficient data sharding, data re-balancing and data distribution using RIPEMD160.
- Highly Available system in case of Failover and/or Network Partitions.
- Open sourced from 3.0 version.
- Can be used in Caching mode with no persistence.
- Supports LRU and TTL.
- Little or No maintenance.
An AVL-Tree will give you O(log n) on insert, remove, search and most everything else.
1 and 3 both scream a database engine.
If your number of records isn't insane and you only have one client using this thing at the same time, I would personally recommend sqlite, which works with both Java and Ruby (also would pass #5). Otherwise go with a real database system, like MySql (since you're not on the Microsoft stack).
精彩评论