Hi,

Maybe there is some misunderstanding, or the documentation is not clear. If
you want, you can use "arbitrary byte arrays" with the MVStore. You don't
*have* to use the DataType interface. But for Java, I think it does make
sense to support classes, so just using byte array doesn't make sense in my
view.

> One thing I really like about leveldb is that both its keys and values
are arbitrary byte arrays.
> it clearly separates storage concerns from object serialization /
representation

I think forcing to use using byte arrays does the reverse: it couples
storage concerns with object representation. But maybe I don't understand
your problem.

> mvstore has pluggable datatypes. But the API becomes a little awkward.

Why? Because of pluggable data types?

some methods are simply taking raw Objects as parameters for example:
>
> public V <http://../../../org/h2/mvstore/MVMap.html> *get*(java.lang.Object 
> key)
>
> The MVStore doesn't have much choice here, unless it want to be
incompatible with java.util.Map. See also
http://stackoverflow.com/questions/857420/what-are-the-reasons-why-map-getobject-key-is-not-fully-generic

So it seems type safety is out the window.
>

You can say the same about java.util.Map. I don't think this is a big
problem.

I wonder if it would be better instead to let the client of mvstore decide
> how to represent data in binary form.
>

Well, that's what the DataType interface is for.


> I bet many of us use google/protobufs, google/flatbuffer, cap'n'proto, etc
> - and its straightforward to convert these to/from byte[].
>

Yes, you can do that, using DataType.

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to