Skip to content

Add streaming read capabilities #1174

@kernle32dll

Description

@kernle32dll

What version of Badger are you using?

2.0

Does this issue reproduce with the latest master?

Yes

What did you do?

I'm using BadgerDB as a versioned document-storage system. It was only after implementing most of my code around it, that I realized that BadgerDB is designed to load values completely into memory, before passing it to the caller.

For my case, that is not quite optimal, as I have no direct control over document size.

What did you expect to see?

Some possibility to pipe values directly to something akin an io.Writer, instead of loading it all into memory.

What did you see instead?

No such method 😢

Next steps

Well, I did get my hands a bit dirty, and dug around a bit in the BadgerDB code. You can find my current WIP here.
I made nice progress in sketching out something that would allow the functionality mentioned above. I verified basic functionality to work using some rough (uncommited) tests 🔥 .

Encryption needs some fixing up, and I have no idea how to implement CRC (that would by definition mean loading everything in memory again...). See my TODO tags.

Is there any interest to further this? I think this feature would be pretty cool, and open new use-cases for BadgerDB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureSomething completely new we should consider.skip/staleSkip stalebotstatus/needs-attentionThis issue needs more eyes on it, more investigation might be required before accepting/rejecting it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions