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

What are the tradeoffs between sql.js and IndexedDB? #576

Closed
githorse opened this issue Feb 19, 2024 · 3 comments
Closed

What are the tradeoffs between sql.js and IndexedDB? #576

githorse opened this issue Feb 19, 2024 · 3 comments

Comments

@githorse
Copy link

The obvious and official solution for SQL-like functionality in the browser is now IndexedDB. Could the docs address the tradeoffs between sql.js and IndexedDB (including performance on large datasets)?

@lovasoa
Copy link
Member

lovasoa commented Feb 19, 2024

IndexedDB is not really SQL - like. If your use case is simple enough to be handled easily with IndexedDB, use IndexedDB. If you need SQL, go with sql.js.

@lovasoa lovasoa closed this as completed Feb 19, 2024
@githorse
Copy link
Author

githorse commented Feb 19, 2024

@lovasoa Yes, that much I know. But I am a smart guy and I can probably make my code work either way. The question is, what are the tradeoffs? (One obvious one is that IndexedDB is persistent, while (raw) sql.js is not. What else should I be considering? What about the performance of some average queries across large datasets -- is there a benchmark?)

If the maintainers of sql.js are not interested in helping users understand these tradeoffs, perhaps someone else from the community can point me to a resource that covers this in more detail?

@milahu
Copy link

milahu commented Mar 30, 2024

what are the tradeoffs

IndexedDB: on-disk, slow, no query language
sql.js: in-memory, fast, SQL query language

ideally, sql.js should support IndexedDB as a storage backend, to reduce memory usage

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

No branches or pull requests

3 participants