object sizes

bryan hunt bhunt at basho.com
Mon Apr 13 06:47:16 EDT 2015


Alex,


Maps and Sets are stored just like a regular Riak object, but using a particular data structure and object serialization format. As you have observed, there is an overhead, and you want to monitor the growth of these data structures.

It is possible to write a MapReduce map function (in Erlang) which  retrieves a provided object by type/bucket/id and returns the size of it's data. Would such a thing be of use?

It would not be hard to write such a module, and I might even have some code for doing so if you are interested. There are also reasonably good examples in our documentation - http://docs.basho.com/riak/latest/dev/advanced/mapreduce

I haven't looked at the Python PB API in a while, but I'm reasonably certain it supports the invocation of MapReduce jobs.

Bryan


> On 10 Apr 2015, at 13:51, Alex De la rosa <alex.rosa.box at gmail.com> wrote:
> 
> Also, I forgot, i'm most interested on bucket_types instead of simple riak buckets. Being able how my mutable data inside a MAP/SET has grown.
> 
> For a traditional standard bucket I can calculate the size of what I'm sending before, so Riak won't get data bigger than 1MB. Problem arise in MAPS/SETS that can grown.
> 
> Thanks,
> Alex
> 
> On Fri, Apr 10, 2015 at 2:47 PM, Alex De la rosa <alex.rosa.box at gmail.com <mailto:alex.rosa.box at gmail.com>> wrote:
> Well... using the HTTP Rest API would make no sense when using the PB API... would be extremely costly to maintain, also it may include some extra bytes on the transport.
> 
> I would be interested on being able to know the size via Python itself using the PB API as I'm doing.
> 
> Thanks anyway,
> Alex
> 
> On Fri, Apr 10, 2015 at 1:58 PM, Ciprian Manea <ciprian at basho.com <mailto:ciprian at basho.com>> wrote:
> Hi Alex,
> 
> You can always query the size of a riak object using `curl` and the REST API:
> 
> i.e. curl -I <riak-node-ip>:8098/buckets/test/keys/demo
> 
> 
> Regards,
> Ciprian
> 
> On Thu, Apr 9, 2015 at 12:11 PM, Alex De la rosa <alex.rosa.box at gmail.com <mailto:alex.rosa.box at gmail.com>> wrote:
> Hi there,
> 
> I'm using the python client (by the way).
> 
> obj = RIAK.bucket('my_bucket').get('my_key')
> 
> Is there any way to know the actual size of an object stored in Riak? to make sure something mutable (like a set) didn't added up to more than 1MB in storage size.
> 
> Thanks!
> Alex
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com <mailto: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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20150413/632eef00/attachment-0002.html>


More information about the riak-users mailing list