Riak Data Storage

If you are trying to store the custom objects in Riak, then please make sure to name the fields appropriately.

For example,
Assume the below custom object

SaveData is a Model class and it has the below fields,
userId
timestamp
value

If we save this information, It will work fine but we will have an issue while trying to retrieve the data with the index[Each bucket should have an index for effective searching and faster retrieval]

so we should hint the data type in the field name. For example, userId is a string field, so we can rename this into userId_s and the timeStamp is a long value, so we can rename this into timstamp_l and value is string field, so we can rename it to value_s

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s