mikeal / dagdb

Syncable database built on IPLD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bug: too many operations in a single transaction will exceed max block size

mikeal opened this issue · comments

The operations list is currently just a list. Need to replace this with a union of either https://github.com/rvagg/iavector or a list and determine an appropriate max-size for using an inline list.

https://github.com/rvagg/js-ipld-vector is an ipld frontend to iavector, as https://github.com/rvagg/js-ipld-hashmap is to iamap, if that helps.

i just realized that, technically, i don’t need this to be ordered, so i could use a hamt keyed by the block’s cid. i wonder which one is more efficient in this case?

If it's only iteration you care about I suspect they're both about equal. The HAMT has a bit of extra metadata and structure that would make their blocks a bit larger, and they're rather opaque to inspect in comparison to Vector. But on the plus side for HAMT, you're already using it so wouldn't need to bring in another complex data structure that people contributing would have to grok.

Interesting.

One thing that the hamt implementation is missing that this seems to have is an efficient bulk creation method. The drawback right now of using the hamt would be generating a lot of garbage setting all the keys individually. I already have this problem on the primary store.