Search Unity

Embedded KeyValue file storage

Discussion in 'Scripting' started by TimCabbage, Apr 13, 2016.

  1. TimCabbage

    TimCabbage

    Joined:
    Feb 13, 2011
    Posts:
    66
    Hi all!

    I am currently working on a game that requires storage of large number of variable length data nodes.
    I was looking for an embedded solution for a key-value storage where I can:
    - Save a binary blob to a string(or integer, could work too) key.
    - Have multiple tables, may be in separate files or in one file.

    I have found the iBoxDB, and tried using it (with *some* success) but the docs are very bad and I can't find how to drop tables there, anyway.
    I was considering a solution like SQLite, but it looks like all inserts and such are made via strings and I want to save binary data. GC pressure is bad.
    Currently looking at DBreeze - is it good?

    Maybe I'm approaching it from a wrong direction entirely?
     
  2. DanHedges

    DanHedges

    Joined:
    Jan 21, 2016
    Posts:
    77
    Hi,

    There is no reason that you cant store binary data in SQLite, take a look at http://effbot.org/zone/sqlite-blob.htm

    I can't answer your DBreeze question as I have never used it, and I am not sure what you mean by "GC Pressure is bad"

    Anyway, I have used SQLite a fair bit and it can certainly handle binary data.
     
  3. TimCabbage

    TimCabbage

    Joined:
    Feb 13, 2011
    Posts:
    66
    Hi. I'm not saying it will not handle it - I'm just saying that I experienced a lot of GC spikes then.

    SQLite wrapper will translate the blob to a string (or it generates the garbage in some other way) and that's what I'm trying to avoid - a simple keyValue storage that uses static byte buffers to transfer data would be best, but I can't find anything that works that way, unfortunately.
    I'm already having issues with GC spikes, and this added GC pressude makes problems into a nightmare.