Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MVStore Support? #34

Closed
buko opened this issue Jun 13, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@buko
Copy link

commented Jun 13, 2019

Permazen supports a great many KVs, but not the very popular MVStore (https://www.h2database.com/html/mvstore.html). Is there a reason for this?

The reason I ask is because we are interested in a kind of mixed-storage model. A single MVStore database that would contain both relational data (and indexes) as well as XML documents. So you might have Permazen talking to one MVStore Map and an existing XMLDocumentStore talking to a different MVStore Map. Queries could be done using Permazen and its nice support for indexes but data would be stored using XML. We already have code that works with XML documents and MVStore which is why I ask about MVStore in particular. But we're not wedded to MVStore...

This is part of a larger problem: "pass through data." We want to store data (as XML) which is not actually part of our object model. I wonder if Permazen has any support for this? I suppose it would be possible to define a field of type byte[] right?

@archiecobbs

This comment has been minimized.

Copy link
Collaborator

commented Jun 14, 2019

Permazen supports a great many KVs, but not the very popular MVStore. Is there a reason for this?

No reason. It looks like a great fit, so I'll look into it.

The reason I ask is because we are interested in a kind of mixed-storage model. A single MVStore database that would contain both relational data (and indexes) as well as XML documents. So you might have Permazen talking to one MVStore Map and an existing XMLDocumentStore talking to a different MVStore Map. Queries could be done using Permazen and its nice support for indexes but data would be stored using XML. We already have code that works with XML documents and MVStore which is why I ask about MVStore in particular. But we're not wedded to MVStore...

This is part of a larger problem: "pass through data." We want to store data (as XML) which is not actually part of our object model. I wonder if Permazen has any support for this? I suppose it would be possible to define a field of type byte[] right?

Permazen allows you to store byte[] fields, so you could just include your XML data as a normal field. The limitation on the length of the stored array is what Java imposes (i.e., 2^31-1 bytes) and what the underlying key-value store imposes (in this case, it looks like MVStore has no particular limitation).

An alternative would be to store bulk data separately in the filesystem or wherever, and then record the pathname as a File field in the corresponding object. You would then just have to also do a little bookkeeping to ensure the bulk files are deleted when the corresponding database object is deleted (you could do this in an @OnDelete method that registers a transaction synchronization callback).

@archiecobbs

This comment has been minimized.

Copy link
Collaborator

commented Jun 18, 2019

Fixed in 54be5c28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.