how to really delete keys from Riak

Alexander Sicular siculars at
Wed Apr 20 14:32:28 EDT 2016

Hello Shifeng,

Riak uses Bitcask as its default data backend, it may also use leveldb
as a backend but must be configured to do so[0][1]. Both bitcask[2]
and leveldb[3] do not reclaim disk space immediately when a delete is
issued. Incidentally, neither do updates. Because Riak is
non-destructive, aka append only, aka no in-place updates, mutation
operations like updates or deletes are actually writes. For example, a
10KB object that is updated four times in some short interval will
consume 50KB space (original 10KB + 4 x 10KB updates) until
merge/compaction occurs. A delete is actually a special zero byte
value write indicating a key is marked for deletion, aka a tombstone.
Bitcask will reclaim disk space via merge operations which may be
controlled by the user. Leveldb reclaims disk space via compaction

Architects and Developers should take into account their update/delete
ratios and consider how those will affect disk space consumption and
consider how deletes operate in distributed systems in general and
Riak in specific from an application perspective. John Daily wrote a
must read four part series on Riak's configurable behaviors that all
Riak developers should be familiar with. Part 3 deals specifically
with delete related considerations[4].

Thank you,


On Wed, Apr 20, 2016 at 8:17 AM, Daniel Abrahamsson
<daniel.abrahamsson at> wrote:
> Hi,
> What riak version and what riak backend are you using? For leveldb you have
> to take compaction into account, and for older bitcask versions there are
> known issues with data not being properly deleted.
> //Daniel
> _______________________________________________
> riak-users mailing list
> riak-users at

More information about the riak-users mailing list