Cassandra客户端Java API [英] Cassandra Client Java API's

查看:189
本文介绍了Cassandra客户端Java API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用Cassandra数据库。现在我正在评估哪个 Cassandra客户端我们应该继续。



我在stackoverflow上看到过各种关于Cassandra使用哪个客户端的帖子,但没有一个非常确定的答案。



我的团队要求我做一些研究,并提出一些优点和缺点 code> Java中的Cassandra客户端API



正如我所提到的,我最近参与了 Cassandra 所以没有那么多的想法为什么某些人选择 Pelops客户和为什么某些人去与 Astyanax 和一些其他客户端。



我知道每个Cassandra客户端的简短信息,我的意思是我能够完成这项工作,并开始读取和写入Cassandra数据库。



以下是我迄今为止的信息。



CASSANDRA APIS




  • Hector(生产就绪)

    最稳定的Java API,

    它不像Hector广泛使用,但它是固体。


  • Kundera(The NoSQL ORM)

    符合JPA,当您想要与Cassandra通过对象。

    这有点限制你将不能有动态数量的
    列/名称等。但它允许你移植ORMs,或者




  • 我只有使用Pelops简要。这是一个直接的API,但似乎没有
    有它的势头。


  • PlayORM(ORM没有约束?)

    我刚刚听说过。看起来它是试图通过引入JQL来解决传统的基于JPA的ORM和NoSQL之间的阻抗
    不匹配。

    低级API。




以下是决定 Cassandra Client -




  • 第一优先级是:低延迟开销,Asynch API和生产环境的可靠性/稳定性。

    (例如,在包装客户端的DAL中可以有更友好的API)。

  • 连接池和分区感知是一些其他好的功能。


  • / ul>

    任何人都可以提供一些想法?此外,每个 Cassandra客户的任何优点和缺点,以及哪个客户可以满足我的要求也将是很大的帮助。



    我相信,主要是我将围绕 Astyanax客户端或使用二进制协议的新Datastax客户端我猜测为止我的研究的基础。



    Astyanax客户端和新Datastax客户端(使用新的二进制协议)之间的任何比较将会非常有帮助。



    这将对我的研究有很大的帮助,并将从不同的人谁使用不同的客户在过去的很多知识。

    解决方案

    Thrift正在成为一个遗留的API:


    首先,你应该知道Thrift API不会得到新的功能;它是为了向后兼容性,不推荐用于新项目。

    - 保罗


    因此,我会避免使用基于Thrift的API(thrift仅保留可向后计算)。



    说如果你确实需要使用基于thrift的API,我会去Astyanax。
    Astyanax是非常容易使用(相比其他thrift API,但我个人的经验是,Datastax的驱动程序更容易)。



    所以你应该看看在 Datastax的 API(和Github repo )?我不知道是否有任何编译版本的API下载,但你可以很容易地构建它与Maven。此外,如果你看看Github repo的提交日志,它经历非常频繁的更新。



    驱动程序仅与CQL3一起使用,并且是异步的,但警告说Cassandra 1.2是最早支持的版本。



    效果

    Astyanax是基于thrift的,datastax的驱动是二进制协议。以下是我可以在thrift和CQL之间找到的最新基准(注意这些都是过时的)。



    Asynch支持

    Datastax的 asynch 支持是明显优于Astyanax的(Netflix 尝试实施,但决定不执行)。



    文档

    我真的反对 Netflix的wiki 。文档非常好,并且相当频繁地更新。他们的Wiki包括代码示例,如果您需要在工作中查看代码,您可以在源代码中找到测试。我试图找到Datastax驱动程序的任何文档,但是测试是在git中心仓库中提供的,所以这是一个起点。



    还要看看这个回答(好..不是我的反正)它看看Thrift的一些优点/缺点和CQL。


    I have recently started working with Cassandra Database. Now I am in the process of evaluating which Cassandra client we should go forward with.

    I have seen various post on stackoverflow about which client to use for Cassandra but none has very definitive answer.

    My team has asked me to do some research on this and come up with certain pros and cons for each Cassandra Client API’s in Java.

    As I mentioned, I recently got involved with Cassandra so not have that much idea why certain people choose Pelops client and why certain people go with Astyanax and some other clients.

    I know brief things about each of the Cassandra clients, by which I mean I am able to make that work and start reading and writing to Cassandra database.

    Below is the information I have so far.

    CASSANDRA APIS

    • Hector (Production-Ready)
      The most stable of the Java APIs, ready for prime-time.

    • Astyanax (The Up and Comer)
      A clean Java API from Netflix. It isn't as widely used as Hector, but it is solid.

    • Kundera (The NoSQL ORM)
      JPA compliant, this is handy when you want to interact with Cassandra via objects.
      This constrains you somewhat in that you won't be able to have a dynamic number of columns/names, etc. But it does allow you to port over ORMs, or centralize storage onto Cassandra for more traditional uses.

    • Pelops
      I've only used Pelops briefly. It was a straight forward API, but didn't seem to have the momentum behind it.

    • PlayORM (ORM without the constraints?)
      I just heard about this. It looks like it is trying to solve the impedance mismatch between traditional JPA-based ORMs and NoSQL by introducing JQL. It looks promising.

    • Thrift (Avoid Me!)
      This is the "low-level" API.

    Below are our priorities in deciding Cassandra Client-

    • First priorities are: low latency overhead, Asynch API, and reliability/stability for production environment.
      (e.g. a more user-friendly APIs that can be had in the DAL that wraps the client).
    • Connection pooling and partition awareness are some other good feature to have.
    • Able to detect any new nodes that got added.
    • Good Support as well (as pointed by dean below)

    Can anyone provide some thoughts on this? And also any pros and cons for each Cassandra Client and also which client can fulfill my requirements will be of great help as well.

    I believe, mainly I will be revolving around Astyanax client or New Datastax client that uses Binary protocol I guess basis on my research so far. But don't have certain information to back my research and present it to my team.

    Any comparison between Astyanax client and New Datastax client(which uses new Binary protocol) will be of great help.

    It will be of great help to me in my research and will get lot of knowledge on this from different people who have used different clients in the past.

    解决方案

    Thrift is becoming more of a legacy API:

    First, you should be aware that the Thrift API is not going to be getting new features ; it's there for backwards compatibility, and not recommended for new projects.
    - the paul

    So I'd avoid Thrift based APIs (thrift is only kept for backwards computability).

    In saying that if you do need to use a thrift based API I'd go for Astyanax. Astyanax is very easy to use (compared to other thrift APIs but my personal experience is that Datastax's driver is even easier).

    So you should have a look at Datastax's API (and Github repo)? I'm not sure if there any compiled versions of the API for download but you can easily build it with Maven. Also if you take a look at the Github repo's commit logs it undergoes very frequent updates.

    The driver works exclusively with CQL3 and is asynchronous but be warned that Cassandra 1.2 is the earliest supported version.

    Performance
    Astyanax is thrift based and datastax's drive is the binary protocol. Here are the latest benchmarks I could find between thrift and CQL (note these are definitely out of date). But in fairness the small difference in performance shown in these benchmarks will rarely matter.

    Asynch support
    Datastax's asynch support is a definite advantage over Astyanax (Netflix tried implementing it but decided not to).

    Documentation
    I cant really argue against Netflix's wiki. The documentation is excellent and its updated fairly frequently. Their wiki includes code examples, and you can find tests in the source code if you need to see the code at work. I struggled to find any documentation of the Datastax driver however test are provided in the git hub repository so that is a starting point.

    Also have a look at this answer (well.. not my one anyway) It looks into some advantages/disadvantages of Thrift and CQL.

    这篇关于Cassandra客户端Java API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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