Have you guys thought about how to write and read back flatbuffers from/to key value stores?
-Arun
--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Forgot to cc the group
I was thinking about support for storing some part of the buffer on the key and the rest on the value to allow for efficient lookup, range queries etc.
Would need relaxation of the single key per table constraint or a new syntax.
On Mon, Sep 12, 2016 at 12:23 PM, Arun Sharma <ar...@sharma-home.net> wrote:
> On Mon, Sep 12, 2016 at 12:11 PM, Wouter van Oortmerssen <w...@google.com> wrote:
>> I think I see what you're doing now.
>> I feel this is a bit too specialized a use case to be supported by the core
>> of FlatBuffers, it be better if it was implemented on top of it.
>
> Agreed. I'm looking for minimal (optional) codgen hooks into flatc to
> get it done. The rest of the support libraries could live elsewhere.
>
Made some changes on the github branch in response to the discussion.
Here's what I'm thinking:
* Most of the key value store logic can stay inside a "builder" that guarantees layout and knows about the key vs value fields. This could either stay out of tree if you prefer or in some loosely coupled directory.
* Need a new data type similar to flatbuffers::Vector. The main difference is that it doesn't assume that length and data are adjacent to each other in memory. Instead, the layout could be <f1, f2, f3> => <length, &f2> if f1, f3 are ints and f2 is a key string. Perhaps call it IndirectVector?
-Arun
Made some changes on the github branch in response to the discussion.
Here's what I'm thinking:
* Most of the key value store logic can stay inside a "builder" that guarantees layout and knows about the key vs value fields. This could either stay out of tree if you prefer or in some loosely coupled directory.
* Need a new data type similar to flatbuffers::Vector. The main difference is that it doesn't assume that length and data are adjacent to each other in memory. Instead, the layout could be <f1, f2, f3> => <length, &f2> if f1, f3 are ints and f2 is a key string. Perhaps call it IndirectVector?
https://github.com/adsharma/flatbuffers/commits/byteorder
https://github.com/adsharma/flatbuffers/blob/41a60f63a599e681e7377eb81f5a855415a7b8d8/tests/kvstore_test1_generated.h#L56