Redis有可嵌入的Java替代品吗? [英] Is there an embeddable Java alternative to Redis?

查看:1252
本文介绍了Redis有可嵌入的Java替代品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据这个线程,Jedis是最好的使用方法,如果我想使用来自Java的Redis。

According to this thread, Jedis is the best thing to use if I want to use Redis from Java.

但是,我想知道是否有任何库/包提供与Redis中已经存在的那些类似的高效集合操作,但可以直接嵌入在Java应用程序中,无需设置单独的服务器。 (即使用Jetty进行Web服务器)。

However, I was wondering if there are any libraries/packages providing similarly efficient set operations to those that already exist in Redis, but can be directly embedded in a Java application without the need to set up separate servers. (i.e., using Jetty for web server).

更准确地说,我希望能够有效地执行以下操作:

To be more precise, I would like to be able to do the following efficiently:


  1. 有一大群M个用户(M不提前知道)。

  2. 有一大套N个项目。

  3. 我们希望用户检查项目,一次一个用户/项目,产生存储结果(在正常数据库中)。

  4. 每个用户到达的时间,我们要为该用户分配用户以前尚未看到的最少现有结果的项目。这样就可以在所有到达的用户身上产生一个大概的循环分配,当我们只是关心所有的项目大致相同的次数。

  1. There are a large set of M users (M not known in advance).
  2. There are a large set of N items.
  3. We want users to examine items, one user/item at a time, which produces a stored result (in a normal database.)
  4. Each time a user arrives, we want to assign to that user the item with the least number of existing results that the user has not already seen before. This produces an approximate round-robin assignment of the items over all arriving users, when we just care about getting all items looked at approximately the same number of times.

上述以并行方式发生。当M和N大时,Redis比SQL查询更有效地完成了上述任务。有没有办法使用一个比启动Redis服务器更轻巧的嵌入式Java库?

The above happens in a parallelized fashion. When M and N are large, Redis accomplishes the above much more efficiently than SQL queries. Is there some way to do this using an embeddable Java library that is a bit more lightweight than starting a Redis server?

我认识到可以编写一堆代码使用Java的并发库,大致近似这个(在某种程度上我已经做到了),但这并不完全是我在这里寻找的。

I recognize that it's possible to write a pile of code using Java's concurrency libraries that would roughly approximate this (and to some extent, I have done that), but that's not exactly what I'm looking for here.

推荐答案

查看项目voldemort 。它是由Linked-In创建的分布式键值存储,它支持嵌入的功能。

Have a look at project voldemort . It's an distributed key-value store created by Linked-In, and it supports the ability to be embedded.

快速入门指南是一个运行嵌入式服务器与独立服务器的小例子。

In the quick start guide is a small example of running the server embedded vs. stand-alone.

VoldemortConfig config = VoldemortConfig.loadFromEnvironmentVariable();
VoldemortServer server = new VoldemortServer(config);
server.start();

我不太了解Redis,所以我无法将其功能与功能进行比较。在项目中,我们使用Voldemort,我们使用它的只读备份存储,效果非常好。它允许我们在我们的处理数据中心中预编译一个双日数据库,并将其运送到边缘数据中心。这样每个边缘数据中心都有一个本地的数据集副本。

I don't know much about Redis, so I can't compare them feature to feature. In the project we used Voldemort, we used it's readonly backing store with great results. It allowed us to "precompile" a bi-daily database in our processing data-center and "ship it" out to edge data-centers. That way each edge data-center had a local copy of it's dataset.

编辑:重读你的问题后,我想添加 Gauva的表 - 此表DataStructure也可能是您寻找的东西并且与许多no-sql数据库相似。

After rereading your question, I wanted to add Gauva's Table -- This Table DataStructure may also be something your looking for and is simlar to what you get with many no-sql databases.

这篇关于Redis有可嵌入的Java替代品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆