Storing JSON in HBase and Id Request

Am I saving JSON data in HBase correctly?

put 'messages', 123, 'cf:json', '{"foo":"bar"}' 

Basically, I need to request it by identifier, which in my example is 123. And JSON is a string of variable length.

+4
source share
1 answer

There is no problem storing JSON in a cell value. Cell sizes up to 5M are still reasonable. Generally speaking, although it is recommended that you keep small sizes of keys and columns (http://hbase.apache.org/book.html#keysize) and JSON, being more compact than XML, it is still a wasteful format (compared to binary JSON , Thrift, Avro, MessagePack, etc.). if you are left with JSON, you might have to consider compressing the column family

+9
source

Source: https://habr.com/ru/post/1380715/


All Articles