简体   繁体   English

Hbase RowKey设计架构

[英]Hbase RowKey design schema

I am using HBase to store webtable content like how google is using bigtable. 我正在使用HBase来存储Web表格内容,例如Google如何使用BigTable。
For reference of google bigtable Google bigtable参考
My question is on RowKey , how we should be forming it. 我的问题是在RowKey上 ,我们应该如何形成它。
What google is doing is saving the URL in a reverse order as you can see in the PDF document "com.cnn.www" so that all the links associated with cnn.com will be manages in same block of GFS which will be lot easier to scan. 谷歌正在做的是按照相反的顺序保存URL,正如您在PDF文档“ com.cnn.www”中所看到的那样,这样,与cnn.com相关的所有链接都将在同一GFS块中进行管理,这将更加容易扫描。
I can use the same thing as google is using but wont it will be cool if I use some algorithm to compress the url 我可以使用与google使用的相同的东西,但是如果我使用某种算法来压缩url,那将不会很酷

For eg. 例如。

RewKey                               |  Google Bigtable                      |  Algorithm output
www.cnn.com/index.php                |  com.cnn.www/index.php                |  12as/435
www.cnn.com/news/business/index.html |  com.cnn.www/news/business/index.html |  12as/2as/dcx/asd
www.cnn.com/news/sports/index.html   |  com.cnn.www/news/sports/index.html   |  12as/2as/eds/scf

Reason behind doing this is rowkey will be shorter as per the Hbase design schema (Mentioned in topic 6.3.2.3. Rowkey Length ). 这样做的原因是,根据Hbase设计模式 (在主题6.3.2.3。Rowkey Length中提到),rowkey会更短。

So what do I need from you guys is to know am I correct over here.... 所以,我需要你们知道我在这里正确吗...。
Also if I am correct what Algorithm I should using. 另外,如果我正确我应该使用什么算法。 I am using python over thrift as a programming language so code will be overwhelming for me... 我在节俭的情况下使用python作为编程语言,所以代码对我来说是压倒性的...

当您缩短URI时,请分别针对主机和路径进行操作并进行连接,这样您的密钥将类似于hostHash!pathHash,一方面可以简化它,另一方面将来自同一站点的所有URI分组在一起

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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