HBase and Redis are similar in function. Both are nosql type databases. However, in the applicable scenario, there are still obvious differences between the two.
The following are based on multiple dimensions such as read and write performance, data type, data volume, deployment difficulty, data reliability, application scenarios, and a combination of the two.
Read and write performance:
HBase writes are slow to read, HBase's read time is usually a few milliseconds, and Redis's read time is usually tens of microseconds. The performance difference is very large.
type of data:
Both HBase and Redis support the KV type. But Redis supports richer types such as List and Set.
The amount of data:
The amount of data supported by Redis is usually limited by memory, and HBase does not have this limitation, and can store data that is much larger than the size of memory.
Easy to deploy:
HBase deployment relies on services such as hadoop and zookeeper, and Redis deployment is very simple.
HBase uses WAL, which records the log and then writes the data. In theory, no data is lost. Redis uses asynchronous replication data, which may lose data when failover.
HBase is suitable for persistent storage of big data, and Redis is more suitable for caching. If data loss is not tolerated, use HBase only; if you need a high-performance environment and can tolerate a certain amount of data loss, then you can consider using Redis.
The combination of the two:
HBase can be used to solidify data, that is, data storage. It is very suitable for him. Redis is suitable for caching. HBase+Redis can be used to implement data warehouse plus cache database, both speed and scalability.
Based on the above comparison, we can see. Both have their own areas of expertise, and there is no substitute for each other. Which service is selected specifically depends on the specific business scenario and the amount of data to select the most suitable solution.