wip: HTTP VFS for read only access to a datadir on a web server #364
Draft
wip: HTTP VFS for read only access to a datadir on a web server #364
Conversation
Contributor
Contributor
|
🚀 Deployed on https://6705845cda92212e1566b5e9--pglite.netlify.app |
Contributor
|
Could this work naturally with S3 / an S3 compatible file store? |
Collaborator
Author
|
@thruflo yes, for a read path it's trivial. For a write path it would be possible to also make work. But still single connection. Although this is "read only", it actually maintains an "overlay" of writes on each file. So it's really a snapshot loaded over http, with in-memory writes. It just doesn't write back to the server. |
0700c43 to
27df87a
Compare
27df87a to
b1c4827
Compare
|
Can we imagine a read/write FS to S3-like storage and in an env where workers (multi-thread) is not allowed ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Export a database from PGlite with
dumpDataDir, with this is now includes anindex.jsonas a file listing. Untar to a web server, use theHttpFsvfs, and point it at the dir on the server:fetchGranularityis self explanatory, when set to"file"it will download the hole file when it is first read,"page"downloads individual file pages using a http range header.Has support for:
XMLHttpRequestwithxhr.responseType = 'arraybuffer', this is only available in a web workerDemo site: https://pglite-httpfs-demo.netlify.app
Screen.Recording.2024-10-03.at.12.25.13.mp4