best practices to work with buckets in java-client

Deepak Balasubramanyam deepak.balu at gmail.com
Sat Feb 16 01:53:57 EST 2013


>
> Can I create it once (on application's start) and store somewhere (like
> static field for example)


Yes you can. There is no need to create the bucket every time the
application starts. The client.fetchBucket() call will get the bucket
successfully on subsequent runs.

Thanks
-Deepak

On Sat, Feb 16, 2013 at 5:00 AM, Guido Medina <guido.medina at temetra.com>wrote:

> I would say it is totally safe to treat them as singleton (static
> reference or just singleton pattern), we have been doing that for a year
> with no issues so far.
>
> Hope that helps,
>
> Guido.
>
>
> On 15/02/13 22:07, Mikhail Tyamin wrote:
>
>> Hello guys,
>>
>> what is the best way to work with Bucket object in java-client?
>>
>> Can I create it once (on application's start) and store somewhere (like
>> static field for example)
>> or I should create it ( riakClient.createBucket("**bucketName") ) once
>> and then fetch it  ( riakClient.fetchBucket("**bucketName") )
>> every time using riakClient when I need it?
>>
>> P.S. I am going to use the same bucket's properties (nVal, allowSiblings
>> and etc.) during all life of application.
>>
>> Thank you.
>>
>> Mikhail.
>> ______________________________**_________________
>> riak-users mailing list
>> riak-users at lists.basho.com
>> http://lists.basho.com/**mailman/listinfo/riak-users_**lists.basho.com<http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com>
>>
>
>
> ______________________________**_________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/**mailman/listinfo/riak-users_**lists.basho.com<http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130216/476677de/attachment.html>


More information about the riak-users mailing list