HBase:节俭vsrestperformance

我知道在HBO上有一些关于REST和Thrift的StackOverflow的文章,但是我想关注一下性能问题。

我一直在使用Node.js中的以下库来连接到一个HBase实例:

  • node-hbase: https : //github.com/wdavidw/node-hbase
  • 节点 – 节俭: https : //github.com/apache/thrift/tree/trunk/lib/nodejs

在弄清楚为什么我不能得到Thrift网关的响应后,我终于得到了两个脚本运行,结果如下(每个输出相当于1000个操作完成):

┌─[mt@Marcs-MacBook-Pro]─[~/Sources/node-hbase] └──╼ node hbase.js hbase-write: 99ms hbase-write: 3412ms hbase-write: 3854ms hbase-write: 3924ms hbase-write: 3808ms hbase-write: 9035ms hbase-read: 216ms hbase-read: 4676ms hbase-read: 3908ms hbase-read: 3498ms hbase-read: 4139ms hbase-read: 3781ms completed ┌─[mt@Marcs-MacBook-Pro]─[~/Sources/node-hbase] └──╼ node thrift.js hbase-write: 4ms hbase-write: 931ms hbase-write: 1061ms hbase-write: 988ms hbase-write: 839ms hbase-write: 807ms hbase-read: 2ms hbase-read: 435ms hbase-read: 562ms hbase-read: 414ms hbase-read: 427ms hbase-read: 423ms completed ┌─[mt@Marcs-MacBook-Pro]─[~/Sources/node-hbase] └──╼ 

使用的脚本可以在这里find: https : //github.com/stelcheck/node-hbase-vs-thrift

我的问题是,有没有人注意到HBase与REST和Thrift之间的区别(甚至只是针对任何应用程序/语言)?

REST以XML或JSONforms提供,以便模式存在于数据本身中。 Thrift并没有这样做:它只是一个字节的负载,然后只能对生成的实体进行反序列化(基于节俭的IDL定义)。

因此,无论数据如何被压缩,节俭必然会更快,因为它不带有任何模式,其成本依赖于其他对象来解释二进制数据。

你可能想试试这个: https : //github.com/alibaba/node-hbase-client

它直接连接到区域服务器和zookeeper。