Howdy Alex!

It's not ludicrous at all since changes in Riak 2.0 should reduce that
overhead to about 13 bytes per key, IIRC.

In these situations, you could always use an external identity generation
process. Here's where I plug Rustflakes [1] which can generate unsigned
64-bit, decimal, or BigInteger numbers based on a combination of time since
an epoch, a machine identifier, and an internally cycling identifier that
resets every millisecond.

I can't lay claim to the idea, but I can lay claim to writing parts of it
in C#.

[1]: https://github.com/peschkaj/rustflakes

---
Jeremiah Peschka - Founder, Brent Ozar Unlimited
MCITP: SQL Server 2008, MVP
Cloudera Certified Developer for Apache Hadoop


On Mon, Sep 30, 2013 at 11:25 AM, Alex Rice <a...@mindlube.com> wrote:

> Although with 40 bytes per key overhead, which I just read about,
> perhaps this is somewhat of a ridiculous optimization for me to be
> attempting to shorten the key size ? :)
>
> On Mon, Sep 30, 2013 at 12:20 PM, Alex Rice <a...@mindlube.com> wrote:
> > Hi all, coming from a traditional database background of course my
> > first tendency was wanting to auto_increment a primary key somewhere.
> > Not possible with Riak, obviously! :)
> >
> > I was wondering if anyone has a good link or white paper about short
> > length hash key creation. I want to keep my keys short to save memory
> > with bitcask storage. (using super low-end commodity hardware with
> > limited RAM)
> >
> > One method that seems like it would be OK:  just to use some
> > unique/random SHA function on the client side, and then take the first
> > few characters from the start of the string
> >
> > SHA output = 55ca6286e3e4f4fba5d0448333fa99fc5a404a73
> >
> > check if 55ca key exists -> (not exist) -> use it
> >  -> exist -> check 55ca6  -> (not exist) -> use it
> >  -> exist -> check 55ca62  -> (not exist) -> use it
> >  -> exist -> check 55ca62  -> (not exist) -> use it
> >  -> exist -> check 55ca628  -> (not exist) -> use it
> >  -> exist -> check 55ca6286 -> (not exist) -> use it
> >  -> exist -> check 55ca6286e  -> (not exist) -> use it
> >  -> etc...
> >
> > But that could involve a lot of back and forth with the server as the
> > key space gets used up...
> > So I thought I would ask on here if there are any nifty ways of
> > generating *short* keys for Riak! Using C# btw, not that it matters :0
> >
> > Sorry if this is a FAQ I didnt see it on the website :)
> >
> > Thanks,
> > Alex
>
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to