放置性能 - Hbase Java 客户端

Put performance - Hbase Java Client

我对 Java 客户端的 PUT 性能做了一些测试,但我不清楚结果。

问题来了: 在 HBase 中做 puts 的最佳方法是什么?有 1000 列(4 个系列)的单个 put,还是有单个列的 1000 个 put?也许 4 个 put,每个 250 列?

理论上,最好的策略是什么?

PS: 我不能使用批处理,因为我需要 Wals for Solr。

谢谢。

首先,尽可能少地使用列族(我在 "HBase in Action" 的 ). Second, you must specify not only your write patterns but also read patterns. HBase works best for "write once and read many" scenarios. Therefore you want to design you table thus it will provide the fastest access to data. And this criterion will determine whether you need "tall" or "wide" table. Check out HBase table design 章节中提供了详细信息。

要获得良好的写入操作性能,您应该对单行使用一个 Put。在其他情况下,性能会显着下降,因为 HBase 会为行键创建一个锁,在这种情况下,大量时间会浪费在同步上。在每行单次放置的情况下,写入性能将与批量加载相当。