Minipg: PostgreSQL as a Single Executable
Hacker News 热议:Minipg: PostgreSQL as a Single Executable(280 赞 / 44 评论,来源 progrium.github.io)
原文开头节选
minipg is PostgreSQL as one executable, ready to use, with no server to configure. A .pgdb directory is the database: its data, config, credentials, and Postgres version all live inside it, and minipg app.pgdb opens a psql shell on it. A server starts when a command needs one and stops on its own when it’s idle.
minipg embeds Docker Hub’s postgres:18-alpine image and runs it with h9 , used as a Zig library. h9’s Linux personality runs Alpine’s own Postgres binaries directly on the host’s hypervisor, with h9’s Plan 9 kernel answering their system calls. There’s no Linux kernel to boot, no VM image, and no Docker.
The demo runs minipg’s Linux build, which runs inside the Postgres image itself. It starts Postgres as ordinary processes and serves on a unix socket, since a page has no TCP. New databases come from a template cluster made at build time, because initdb takes half a minute on v86.
minipg app.pgdb # psql shell (creates app.pgdb if missing) minipg app.pgdb “select 1” # one statement minipg url app.pgdb # postgres://postgres:…@127.0.0.1:54321/app minipg serve app.pgdb # an …
(以上为原文节选,完整内容见下方”原文来源”)
这条动态今日登上 Hacker News 首页(280 赞 / 44 评论,来源 progrium.github.io)。技术雷达每日自动聚合 AI 工程、后端架构、DevOps 方向的前沿动态;相关工程落地可浏览下方的相关服务与延伸阅读,或直接与我们团队交流。
原文来源: Hacker News