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

investigate "storage buckets" #1

Closed
getify opened this issue Aug 13, 2024 · 4 comments
Closed

investigate "storage buckets" #1

getify opened this issue Aug 13, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@getify
Copy link
Member

getify commented Aug 13, 2024

https://developer.chrome.com/docs/web-platform/storage-buckets

@getify getify self-assigned this Aug 21, 2024
@getify getify added the enhancement New feature or request label Aug 21, 2024
@getify getify transferred this issue from mylofi/local-vault Aug 30, 2024
@MatheusBonavite
Copy link

Hello @getify, I might be stating the obvious here so pardon me if this is the case.

However, it seems like Storage Buckets operate on top of an already established storage API, like indexedDB: which you are already using through the "idb-keyval" package! Notice that somebody has already pushed this conversation there:
jakearchibald/idb-keyval#174

If they work on that I believe you could do some testing for free, or almost for free, in this amazing project with Storage Buckets. Or, you could clone that dependency and do the suggestion in the opened issue and then use the set/get APIs with the small change of using StorageBucket.indexedDB instead of window.indexedDB.

Dropped this two cents here just to see if it helps! Regards

@getify
Copy link
Member Author

getify commented Sep 18, 2024

TBH I only found the article about them, haven't read it yet, don't know what they're for or if they're relevant at all here. this is mostly a research task, not yet a dev task. :)

@Suyog1702
Copy link

Here’s a concise summary of the Storage Buckets API:

Multiple Storage Buckets: Developers can create separate buckets to prioritize which data to keep or discard under storage pressure

Granular Control: Allows for fine-grained control over persistent storage, avoiding the traditional "all-or-nothing" approach for data persistence​

Eviction Prioritization: Developers can assign priorities to buckets, ensuring important data (e.g., unsent drafts) remains while less critical data can be evicted​

Customizable Durability: Buckets can have different durability settings—strict for safer but slower writes, or relaxed for faster, more performance-optimized writes

API Compatibility: Works with common web storage APIs like IndexedDB, Cache API, and File API​

DevTools Integration: Storage buckets can be debugged and monitored via Chrome DevTools

Hope this helps :)​

@getify
Copy link
Member Author

getify commented Sep 26, 2024

Thanks for the info. After thinking about it, I don't think this makes sense for this library, at this time. If it expands beyond a Chrome-only feature, it may be worth re-visiting.

@getify getify closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants