2

I am using a badger database and I want to retireve my values in the FIFO order. Right now they seem to be stored alphabetically, Can I tweak some defaultOptions to make sure I get them in FIFO fashion?

Vinayak Anil
  • 51
  • 1
  • 3

1 Answers1

0

Can I tweak some defaultOptions to make sure I get them in FIFO fashion?

Assuming you mean iteration order then no you cannot

However you can prefix the keys with a monotonically increasing id which will give you fifo ordering

If you want a queue on disk you can use https://github.com/EighteenZi/rocksdb_wiki/blob/master/Implement-Queue-Service-Using-RocksDB.md as a template

Asad Awadia
  • 1,417
  • 2
  • 9
  • 15