PGlite
Run a full Postgres database locally in WASM with reactivity and live sync.
rofl
Public notes from activescott tagged with #postgres
Run a full Postgres database locally in WASM with reactivity and live sync.
rofl
It is possible to use an NFS file system for storing the PostgreSQL data directory. PostgreSQL does nothing special for NFS file systems, meaning it assumes NFS behaves exactly like locally-connected drives. PostgreSQL does not use any functionality that is known to have nonstandard behavior on NFS, such as file locking.
The only firm requirement for using NFS with PostgreSQL is that the file system is mounted using the
hardoption. With thehardoption, processes can “hang” indefinitely if there are network problems, so this configuration will require a careful monitoring setup.
It is not necessary to use the
syncmount option. The behavior of theasyncoption is sufficient, since PostgreSQL issuesfsynccalls at appropriate times to flush the write caches. (This is analogous to how it works on a local file system.) However, it is strongly recommended to use thesyncexport option on the NFS server on systems where it exists (mainly Linux). Otherwise, anfsyncor equivalent on the NFS client is not actually guaranteed to reach permanent storage on the server, which could cause corruption similar to running with the parameter fsync off.
After watching this amazing talk, I realized that as long as we can guarantee that WAL (Write-Ahead Logs) buffers are written to the network storage, the database should be able to recover from the errors in case of a failure. Armed with this knowledge, I made an attempt on storing Postgres data on an NFS share.
With @supabase/server you just declare who can call your endpoint and get a fully initialized context back:
User-scoped Supabase client Admin client with service role access Verified user identity JWT claims Built-in request/auth helpers
A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.