The Postgres WASM project has prepared a browser-based environment with the PostgreSQL DBMS

The developments of the Postgres WASM project, which develops an environment with the PostgreSQL DBMS, working inside the browser, are open. The code associated with the project is open source under the MIT license. A toolkit is proposed for building a virtual machine running in a browser with a stripped-down Linux environment, a PostgreSQL 14.5 server and related utilities (psql, pg_dump). The size of the final assembly is about 30 MB.

The filling of the virtual machine is formed using buildroot scripts and launched in the browser using the v86 emulator. A web shell is provided for interacting with PostgreSQL utilities from a browser. To access the PostgreSQL server running in the browser over the network and perform network requests from the virtual machine, a proxy is used that forwards traffic using the Websocket API.

Key features of Postgres WASM:

  • Saving and restoring the state of the DBMS from a file or browser storage based on IndexedDB.
  • Quick launch from a file with a saved state of the virtual machine or a full launch with an emulator restart.
  • The ability to allocate from 128 to 1024MB of memory to a virtual machine.
  • Web terminal font size setting.
  • Support for uploading files to a virtual environment, including the ability to upload database dumps.
  • Support for downloading files from a virtual environment.
  • Establishing incoming and outgoing network connections, creating a tunnel to forward requests to network port 5432.

Among the possible applications of Postgres WASM are the creation of demo and training systems, organizing work with data in offline mode, analyzing data while in offline mode, testing PostgresSQL functionality and configurations, creating a local developer environment, preparing slices of a certain state of the DBMS for sending to others. developers or support team, testing logical replication from external DBMS.

The Postgres WASM project has prepared a browser-based environment with the PostgreSQL DBMS


Source: opennet.ru

Add a comment