hbase,相同结构的多个 table 或包含大量数据的单个 table 的性能更有效?

what is more efficient in performance of hbase,multiple tables of same structure or a single table containing large set of data?

我之前创建了一个项目,通过为每一天创建一个 table 并将当天的数据存储在这个 table.[=11 中,从而在 RDMS 中存储特定实体的日常数据=]

但现在我想将我的数据库从 RDMS 转移到 HBase。所以我的问题是我是否应该创建一个 table 并在 table 中存储所有日期的数据,或者我应该使用我之前的概念为每个 [=17= 创建一个单独的 table ] 想根据 hbase 的性能比较这两种情况。

抱歉,如果这个问题对 you.Thank 你来说似乎很愚蠢

如您所述,有 2 个选项


Option 1: Single table of all days data
Option 2: multiple tables


如果你一天有大量数据,我更喜欢选项 2 的命名空间(在 0.96 版本中引入是一个非常重要的功能)。这也将支持多租户要求...

参见 Hbase Book

  • A namespace is a logical grouping of tables analogous to a database in relation database systems. This abstraction lays the groundwork for upcoming multi-tenancy related features: Quota Management (HBASE-8410)
  • Restrict the amount of resources (ie regions, tables) a namespace can consume.
  • Namespace Security Administration (HBASE-9206) - Provide another level of security administration for tenants.
  • Region server groups (HBASE-6721) - A namespace/table can be pinned onto a subset of - RegionServers thus guaranteeing a course level of isolation.

below are commands w.r.t. namespaces

alter_namespace, create_namespace, describe_namespace, 
drop_namespace, list_namespace, list_namespace_tables

优点:

  • 即使您使用列过滤器,由于它的数据较少(每天的数据),与单一 table 方法(对大 table 很贵)
  • 如果你想在特定的 table 上进行身份验证和授权,那么它也可以实现。

限制 :您最终将使用多个脚本来管理 table 而不是单个脚本(选项 1)

注意:在上面提到的任何选项中,您的 rowkey 设计对于更好的性能和防止热点非常重要。

有关详细信息,请参阅 hbase-series