简体   繁体   中英

Storing List data in Hbase?

Im trying to store a list,collection of data objects in Hbase. For example,a User table where a the userId is the Rowkey and column family Contacts with column Contacts:EmailIds where EmailIds is a list of emails as

{abcd@example.com,bpqrs@gmail.com....etc}

How do we model this in Hbase? How do we do this in Java?/Python?Ive tried pickling and unpickling data in Python but this is one solution which I do not want to use due to performance issues.

You can use it in the following manner:

| userid | contacts                                              |
| test   | c:email1=test@example.com; c:email2=te.st@example.com |

or

| userid | contacts                                              |
| test   | c:test@example.com=1; c:te.st@example.com=2           |

This way you can use versioning, add/remove as much email addresses as you want, use filters, and it is really easy to iterate over these KV pairs in the client code

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