HBase is a store for reading and writing single records by key at large scale. On Cloudera it runs as a set of region servers coordinated by an HMaster, with data in HFiles and changes first written to a write-ahead log. Most incidents trace back to row-key design, region count, compaction backlog or untested recovery. This guide covers all four, with a checklist you can run this week.
Architecture
Tables are split into regions, and each region is served by one region server. Writes go to a write-ahead log and an in-memory store, which flushes to HFiles. Compaction merges HFiles. The HMaster assigns regions and ZooKeeper tracks server state. Cloudera Runtime 7.3.1 on Private Cloud Base uses HBase 2.4.17 and supports JDK 17.
The Apache HBase reference guide gives the flush rule: when the in-memory store reaches the size set in hbase.hregion.memstore.flush.size, it flushes to a store file. Over time the store file count rises, which is why compaction exists.
Sizing
| Driver | Why it matters | What to check |
|---|---|---|
| Row-key design | Decides how evenly load spreads across regions | Look at request counts per region |
| Data size and growth | Sets region and server counts | Plan for peak plus growth |
| Read and write mix | Sets cache and memory split | Measure, do not guess |
| Number of column families | Each has its own files and compaction | Keep them few |
| Recovery target | Sets replication and backup design | Time a restore |
Specific numbers, such as regions per server and heap sizes, depend on your release and workload. We set them from measurements, not rules of thumb. For orientation, the Apache reference guide says HBase is designed to run a small number of relatively large regions per server, in the range of 20 to 200 regions of 5 to 20 GB, and that around 100 regions per server has often given the best results. It gives two reasons. Each region's memstore takes buffer memory before any data arrives, and too many regions force tiny flushes that trigger extra compactions. Treat these as the guide's orientation, not as your target.
Row-key design and hotspots
HBase sorts rows by key. That helps scans, but a poorly designed key sends most traffic to one region server. The reference guide names four techniques:
| Technique | How it works | Cost |
|---|---|---|
| Salting | Add a random prefix so writes spread over several regions | Reads must gather rows from every prefix, and lose natural order |
| Hashing | Use a one-way hash so each key always gets the same prefix | Point reads stay easy, range scans on the original key do not |
| Reversing the key | Put the fast-changing digits first | Loses the natural sort order |
| Reverse timestamp | Append Long.MAX_VALUE minus the timestamp so the newest row sorts first | Suits "latest value for a key" reads only |
Row keys cannot be changed later. The only way to change one is to delete the row and insert it again, so settle the design before the table holds much data. Pre-split new tables so load spreads from day one: in the HBase shell, n split points create n plus 1 regions.
# HBase shell: create a table pre-split into five regions on hex keys
create 'events', 'f', { NUMREGIONS => 5, SPLITALGO => 'HexStringSplit' }Compaction in plain terms
Minor compactions merge a few small adjacent files. Major compactions rewrite every file in a store into one, and only they remove deleted data and expired versions. Deletes write a tombstone first, and the data goes only at major compaction. By default major compactions run about once every seven days. The reference guide warns against disabling them altogether, because they are needed for store file clean-up. On a busy cluster, schedule them for a quiet window and run them by hand if you need to control the timing.
Keep column families to a minimum. The guide says HBase does not do well beyond two or three, because flushing works per region and compaction per store, so a busy family drags its quiet neighbors into extra I/O.
Operations checklist
- Watch request counts per region, to catch hotspots early.
- Track compaction queues and storefile counts per region.
- Alert on region server memory pressure and long pauses.
- Monitor replication lag if you replicate between clusters.
- Time a full restore at least twice a year.
- Rehearse upgrades and keep a rollback.
Backup, replication and recovery
Cloudera's HBase backup guide covers snapshots, export and replication. A snapshot has little impact on region servers, and clone and restore copy no data, because HFiles are immutable. Exporting a snapshot to another cluster also has little impact on the source servers. A restore sets the table back to the snapshot, so changes made afterward are lost.
| Mechanism | Good for | Know this |
|---|---|---|
| Snapshot | Point-in-time copy, safe changes, quick restore | It is a copy in the same cluster until you export it |
| Snapshot export | Moving a copy to another cluster | Time the import on the target |
| Asynchronous replication | Disaster recovery and keeping a second cluster current | The reference guide says recovery from it can lose recent data, because the WAL is shipped in the background |
| Synchronous replication | Tighter recovery goals | A different mechanism, described separately in the guide |
The guide also notes that replication works per column family, that you create the table and families on the target first, and that replication and WAL compression have a known compatibility problem, so check your settings together.
Recovery time after a server loss has a formula in the guide: ZooKeeper session timeout, plus split time, plus assignment and replay time. In-flight queries are retried, not lost. The more regions on the failed server, the longer the last two parts take, so region count is also a recovery setting.
Common issues
- Hotspots from monotonically increasing row keys. Use salting or reversed or hashed prefixes where reads allow.
- Compaction backlog after a burst of writes, shown as rising storefile counts and slower reads.
- Long recovery after a region server loss because too many regions sat on it.
- Slow scans because a workload that needs analytics runs on HBase. Consider Kudu or Iceberg for those reads.
- Native-API edits to tables that Phoenix manages, which Cloudera warns can corrupt data and indexes.
Questions we hear
Can HBase run analytics? It can scan, but it is built for key lookups and short ranges. Heavy scans belong on Impala with Kudu or Iceberg.
How many column families should we use? One if you can. Add a second or third only when you usually read one family or the other, not both.
For SQL on HBase see Apache Phoenix on HBase. If your storage layer is changing, see HDFS to Ozone migration steps. A review of an existing cluster is described in an HBase health check example and on the Cloudera Operational Database page.
A first engagement
Duczer East offers an HBase health check: we read your region and compaction metrics, review your row keys against real traffic, time a restore and hand back a ranked fix list.




