ApsaraDB for HBase writes data into HLog and Memory based in the Log-Structured Merge (LSM) mode. This means that ApsaraDB for HBase does not perform random input/output (I/O) operations, providing high performance and stability for write operations. In most database solutions, write operations are optimized for reliability at the cost of performance.

The batch write feature is provided to decrease the number of Remote Procedure Calls (RPC).

HTable.put(List<Put>)       

Auto Flush

You can greatly improve write performance by setting Autoflush to false. However, we recommend that you wait until 2 MB of data is buffered (hbase.client.write.buffer) or the hbase.flushcommits() command is called before you call Autoflush on a RegionServer. The data is not written to the remote database.

HTable.setWriteBufferSize(writeBufferSize) can be used to set the buffer size.

Server optimization

WAL Flag

You can disable Write Ahead Log (WAL) to greatly improve write performance. This is because when WAL is disabled, no writes are performed to HLog, which reduces the number of I/O operations. Only in-memory writes to Memstore are performed.

This operation is applicable to scenarios where performance is prioritized over reliability.

Increase the memory size of Memstore

You can also increase the value of Memstore and reduce the value of BlockCache to improve write performance. This is the opposite of read optimization.

Check whether a large number of HFile files are generated

At high write speeds, a large number of HFiles are generated. This is because the merge speed of HFiles are slower than that of write operations.

To ensure efficient usage of resources, we recommend that you perform a major compaction during off-peak hours. If the number of HFiles cannot be reduced, we recommend that you add more nodes.