什么是 Azure HDInsight 中的 Apache HBaseWhat is Apache HBase in Azure HDInsight

Apache HBase 是一种开源 NoSQL 数据库,它构建在 Apache Hadoop 的基础之上,并基于 Google BigTable 模型化。Apache HBase is an open-source, NoSQL database that is built on Apache Hadoop and modeled after Google BigTable. HBase 针对无架构数据库中的大量数据提供随机访问和强一致性。HBase provides random access and strong consistency for large amounts of data in a schemaless database. 数据库按列系列进行组织。The database is organized by column families.

从用户角度来看,HBase 类似于数据库。From user perspective, HBase is similar to a database. 数据存储在表的行和列中,行中的数据按列系列分组。Data is stored in the rows and columns of a table, and data within a row is grouped by column family. HBase 是一个无架构数据库。HBase is a schemaless database. 列和数据类型可以不定义便使用。The columns and data types can be undefined before using them. 开放源代码可进行线性伸缩,以处理上千节点上数 PB 的数据。The open-source code scales linearly to handle petabytes of data on thousands of nodes. 开放源代码可依赖 Hadoop 环境中的分布式应用程序提供的数据冗余、批处理以及其他功能。It can rely on data redundancy, batch processing, and other features that are provided by distributed applications in the Hadoop environment.

如何在 Azure HDInsight 中实现 Apache HBase?How is Apache HBase implemented in Azure HDInsight?

HDInsight HBase 以集成到 Azure 环境中的托管群集形式提供。HDInsight HBase is offered as a managed cluster that is integrated into the Azure environment. 这些群集配置为在 Azure 存储中直接存储数据,这样就减少了延迟,并提高了选择性能和价格的弹性。The clusters are configured to store data directly in Azure Storage, which provides low latency and increased elasticity in performance and cost choices. 此属性使客户能够构建用于处理大型数据集的交互式网站。This property enables customers to build interactive websites that work with large datasets. 构建用于存储数百万个终结点的传感器和遥测数据的服务。To build services that store sensor and telemetry data from millions of end points. 以及使用 Hadoop 作业分析这些数据。And to analyze this data with Hadoop jobs. 对于 Azure 中的大数据项目,HBase 和 Hadoop 是不错的起点。HBase and Hadoop are good starting points for big data project in Azure. 实时应用程序可以利用这些服务来处理大型数据集。The services can enable real-time applications to work with large datasets.

HDInsight 实现使用 HBase 的横向扩展体系结构自动提供表分片,The HDInsight implementation uses the scale-out architecture of HBase to provide automatic sharding of tables. 并提供读写强一致性和自动故障转移。And strong consistency for reads and writes, and automatic failover. 性能可通过对读取使用内存中缓存并对写入使用高吞吐量流式处理来提高。Performance is enhanced by in-memory caching for reads and high-throughput streaming for writes. 可以在虚拟网络内部创建 HBase 群集。HBase cluster can be created inside virtual network. 有关详细信息,请参阅在 Azure 虚拟网络上创建 HDInsight 群集For details, see Create HDInsight clusters on Azure Virtual Network.

如何在 HDInsight HBase 中管理数据?How is data managed in HDInsight HBase?

数据可以在 HBase 中通过使用 HBase shell 中的 creategetputscan 命令来管理。Data can be managed in HBase by using the create, get, put, and scan commands from the HBase shell. 数据通过使用 put 写入到数据库,并通过使用 get 读取。Data is written to the database by using put and read by using get. scan 命令用于从表中的多行获得数据。The scan command is used to obtain data from multiple rows in a table. Data 也可以使用 HBase C# API 进行管理,该 API 在 HBase REST API 顶部提供客户端库。Data can also be managed using the HBase C# API, which provides a client library on top of the HBase REST API. HBase 数据库还可以通过使用 Apache Hive 进行查询。An HBase database can also be queried by using Apache Hive. 有关这些编程模型的简介,请参阅开始在 HDInsight 中将 Apache HBase 与 Apache Hadoop 配合使用For an introduction to these programming models, see Get started using Apache HBase with Apache Hadoop in HDInsight. 共同处理器也适用,这样,便可在托管数据库的节点中处理数据。Coprocessors are also available, which allow data processing in the nodes that host the database.

备注

Thrift 不受 HDInsight 中的 HBase 支持。Thrift is not supported by HBase in HDInsight.

Apache HBase 用例Use cases for Apache HBase

BigTable(以及延伸开来的 HBase)是从 Web 搜索创建的典型用例。The canonical use case for which BigTable (and by extension, HBase) was created from web search. 搜索引擎构建索引,将词语映射到包含这些词语的网页。Search engines build indexes that map terms to the web pages that contain them. 然而,还有 HBase 适用的许多其他用例,本部分中列出了其中几个。But there are many other use cases that HBase is suitable for—several of which are itemized in this section.

方案Scenario 说明Description
键值存储Key-value store HBase 可用作键-值存储,适合于管理消息系统。HBase can be used as a key-value store, and it's suitable for managing message systems. Facebook 使用 HBase 作为其消息系统,它最适合于存储和管理 Internet 通信。Facebook uses HBase for their messaging system, and it's ideal for storing and managing Internet communications. WebTable 使用 HBase 搜索和管理从网页中提取的表。WebTable uses HBase to search for and manage tables that are extracted from webpages.
传感器数据Sensor data HBase 用于捕获从各种源逐步收集的数据。HBase is useful for capturing data that is collected incrementally from various sources. 这些数据包括社交分析和时序。This data includes social analytics, and time series. 并使交互式仪表板保持显示最新趋势和计数器,以及管理审核日志系统。And keeping interactive dashboards up to date with trends and counters, and managing audit log systems. 具体示例包括:Bloomberg 交易终端以及开放时序数据库 (Open Time Series Database, OpenTSDB)。Examples include Bloomberg trader terminal and the Open Time Series Database (OpenTSDB). OpenTSDB 存储所收集的服务器系统运行状况相关指标并提供了访问这些指标的方式。OpenTSDB stores and provides access to metrics collected about the health of server systems.
实时查询Real-time query Apache Phoenix 是 Apache HBase 的 SQL 查询引擎。Apache Phoenix is a SQL query engine for Apache HBase. 它以 JDBC 驱动程序的形式供用户访问,并且支持使用 SQL 来查询和管理 HBase 表。It's accessed as a JDBC driver, and it enables querying and managing HBase tables by using SQL.
HBase 即平台HBase as a platform 应用程序可以将 HBase 作为数据存储库而在其上运行。Applications can run on top of HBase by using it as a datastore. 具体示例包括 Phoenix、OpenTSDB、Kiji 和 Titan。Examples include Phoenix, OpenTSDB, Kiji, and Titan. 应用程序也可以与 HBase 集成。Applications can also integrate with HBase. 示例包括:Apache Hive、Apache Pig、Solr、Apache Storm、Apache Flume、Apache Impala、Apache Spark、Ganglia 和 Apache Drill。Examples include: Apache Hive, Apache Pig, Solr, Apache Storm, Apache Flume, Apache Impala, Apache Spark, Ganglia, and Apache Drill.

后续步骤Next steps