Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Add StorageDriverIndexedDb #108

Merged
merged 1 commit into from
Dec 30, 2021
Merged

Add StorageDriverIndexedDb #108

merged 1 commit into from
Dec 30, 2021

Conversation

sgwilym
Copy link
Contributor

@sgwilym sgwilym commented Dec 6, 2021

What's the problem you solved?

This adds a very basic version of a storage driver that persists to IndexedDB. 5mb localstorage shackles be gone!

What solution are you recommending?

Upon the first usage of the storage, docs are hydrated into memory from a single IndexedDB row. Every time the storage upserts a doc, it writes all docs in memory back into that single row. I told you it was basic!

We do this because reading and writing stuff to IndexedDB is very slow. But this isn't an approach that'll last because of the aforementioned 'loads the whole space into memory' thing.

The storage config is stored inside of a separate object store, and works more or less as you would normally use IndexedDB.

@sgwilym sgwilym added the enhancement New feature or request label Dec 6, 2021
@sgwilym sgwilym merged commit 78a2826 into main Dec 30, 2021
@sgwilym sgwilym deleted the indexeddb-basic branch December 30, 2021 12:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant