-
Notifications
You must be signed in to change notification settings - Fork 217
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
wip: HTTP VFS for read only access to a datadir on a web server #364
base: main
Are you sure you want to change the base?
Conversation
🚀 Deployed on https://6705845cda92212e1566b5e9--pglite.netlify.app |
Could this work naturally with S3 / an S3 compatible file store? |
@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 ? |
Export a database from PGlite with
dumpDataDir
, with this is now includes anindex.json
as a file listing. Untar to a web server, use theHttpFs
vfs, and point it at the dir on the server:fetchGranularity
is 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:
XMLHttpRequest
withxhr.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