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

Adding denoKV to doc drivers #326

Open
ssv0 opened this issue Mar 17, 2024 · 4 comments
Open

Adding denoKV to doc drivers #326

ssv0 opened this issue Mar 17, 2024 · 4 comments

Comments

@ssv0
Copy link

ssv0 commented Mar 17, 2024

Hi, sneakspeak dev here: to make earthstar server deployable on "deno deploy" I added support to denokv doc driver, modding localstorage driver. So if you look to add support for deno kv the modded driver is in this repo:

https://github.com/ssv0/denodeploy-denokv

Feel free to take inspiration or add it to main repo. Maybe it would be better to use different keys instead of putting all docs in an entry.

@sgwilym
Copy link
Contributor

sgwilym commented Mar 17, 2024

Thank you for sharing this, and for creating this driver.

I see that you use the memory attachment driver, do you not use attachments?
How is sync on deno deploy? Do the websocket connections live long enough for sync to happen?

You're right that putting data in different keys would be (vastly) better than a single entry. The reason that this approach is workable with LocalStorage is because it can store a maximum of 5mb. Deno KV can take much more, so performance will degrade as the number of stored docs grows.

The next version of Earthstar will have a ground-up Deno.KV driver via willow-js: https://github.com/earthstar-project/willow-js/blob/main/src/store/storage/kv/kv_driver_deno.ts

There will be initial builds of willow-powered Earthstar in the coming months. Would you be interested in trying it, and seeing how it is to migrate sneakspeak to it?

@ssv0
Copy link
Author

ssv0 commented Mar 20, 2024

I still have to test denokv, as far as I know there seem to be problems when new instances are launched with an existing (because it's global) kv but maybe I just misconfigured the client. I think sneakspeak will benefit from willow features so I'm definitely trying it out.

@sgwilym
Copy link
Contributor

sgwilym commented Jun 7, 2024

@ssv0 Sorry, realised I never updated you on this. Earthstar 11 now has a beta available: https://jsr.io/@earthstar/[email protected]

Soon it'll also get sneakernet-style capabilities via Willow's new sideloading protocol.

@ssv0
Copy link
Author

ssv0 commented Aug 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants