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

Which VFS is the best? #85

Closed
rhashimoto opened this issue Apr 23, 2023 · 0 comments
Closed

Which VFS is the best? #85

rhashimoto opened this issue Apr 23, 2023 · 0 comments
Labels
faq Frequently asked question

Comments

@rhashimoto
Copy link
Owner

rhashimoto commented Apr 23, 2023

As usual...it depends.

The primary reason wa-sqlite was created was to experiment with different APIs and ideas for SQLite storage. The example VFS classes were written to try a variety of approaches to see what works, what doesn't, and where to go next. Definitely not all but also perhaps not any may be well-suited for your application. You're welcome to use one but modifying an example VFS or writing your own to fit your requirements may be better, and that's really the spirit of the project.

One result of this project is there is no ideal VFS across all applications. All the sample VFS classes have their own strengths and weaknesses. There is a table comparing sample VFS features here, and there is a lot more information on VFS trade-offs in the Ideas discussion category.

If I were forced to choose only one VFS for all browser applications, I would first grumble a lot and then grudgingly choose IDBBatchAtomicVFS. Its excellent compatibility across browsers and context types (Window, Worker, shared worker, service worker, extension) make it a solid general purpose choice.

It isn't at all difficult to switch from one VFS to another during development (i.e. as long as converting an existing database is not needed). For example, in the hello demo the VFS is specified with a single line of code (adding non-default VFS options would be slightly more involved). Comparing different VFS classes with your application is a great way to determine which one is "best" for you.

@rhashimoto rhashimoto added the faq Frequently asked question label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
faq Frequently asked question
Projects
None yet
Development

No branches or pull requests

1 participant