Hi Green,
AFAICT, protocol buffers does not have inbuilt support for searching
and querying, at least not in the public domain release.

However, you should be able to use protocol buffers in your particular
scenario. Since your data is more or less read-only once it's
serialized, you should be able to serialize the wire format data such
that your 'Row' messages are sorted on your 'primary key'; just keep
the repeated rows field sorted on that key before serializing.
Additionally, you should also be able to build indices on any other
parameter to speed up serach/query on those parameters.

The Drizzle link that you have given is interesting. I had quick look
at it. If you have noticed, they are building their own indices and
are planning to use PB to store those indices also.

PS: I am a newbie to PB, so take what I said with a pinch of salt.

green wrote:
> I am interested in using protocol buffers for the following scenario:
>
> I have a large number of small data points I need to serialize to a
> file. Once this serialization process is complete, the data will be
> strictly read only, accessed by multiple threads, until I need to
> create a new version of the file. The application will access the file
> at startup, and while executing will need to retrieve data points
> based on a given parameter. Pretty much behaves like tabular data you
> would find in a database table. I need to retrieve a "row", based on a
> "primary key". Yet a traditional database is not a good solution in
> this situation.
>
> My understanding is that it's not a good idea to have large messages,
> but you can have a large number of small messages within a file, and
> it shouldn't be a problem. I have seen the .proto file structure and
> how messages are determined. What I don't understand (maybe I missed
> that part in the documentation) is how to make searches for messages
> within a file. If I use the "repeated" qualifier, it will let me have
> more than one message in another one, but I'll just retrieve it as a
> list. I can't specify what subset of messages I want.
>
> Can I sort messages based on a given field?
> Can I request a subset of messages by index range, or some other
> criteria?
> Can I "browse" through a message file, given a particular search
> parameter?
> Can I have some sort of Map inside the .proto definition, where I
> organize elements in key - value fashion?
>
> Alternatively, are my assumptions of what I should be able to do with
> protocol buffers wrong from the start? I assumed this kind of thing
> was possible since the drizzle devs are using protocol buffers for
> their database implementation. Link below.
>
> http://drizzle.org/wiki/Table_Proto_Definition
>
> Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to