简体   繁体   中英

How to store and query range data in HBase?

Presently, I am storing Ip mapping data in Solr and it's somewhat like this:

Ip-From
Ip-To
Country

This forms a single record (document.) When I get a IP as an input, I query Solr to find out the region (country) that it belongs to. The query is straight forward - ip >= ipFrom and ip <= ipTo. The response time is pretty low (good) but still does not meet our requirement. Cannot cache this data in memory as it's very huge.

Hence, I was thinking of using some other storage for this type of data. Is HBase suitable, and if yes, what would be the ideal way of storing and querying such type of data?

My understanding : you want to pass Ip (either from or to) and you want to lookup country or region specific to that.

Yes. You an store data in Hbase and query with filters if you want to use Hbase as only data store.

In my experience, Solr search is faster than Hbase and can use NRT or Batch indexer(in case you are using CDH) or some other tool to index Hbase data.

Further more, Whitefret raised the concern(which sounds logical to me). along with ipfrom , ipto and country , if you storing anything else in solr then hbase can work for you . otherwise there is no need for intermediate storage like Hbase and you need to revisit your solr configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM