← @bgSponge

Actually Queryable Executables

Summary

F. Zakaria proposes SELF, a format where the executable is a SQLite database, allowing programs to store state, assets, and logs transactionally within their own file.

  1. SELF collapses application state.

    By using a SQLite file as the executable, programs can store all state in the same file they run from, removing the need for /var/ or /home/ directories.

    The program can store its own state in the same file it is running from

  2. The interpreter enables self-access.

    Because binfmt_misc executes an interpreter rather than the file directly, the interpreter passes the executable path via argv[0] so the program can open its own database.

    the program’s argv[0] is the path to the executable itself

  3. self-httpd proves the concept.

    This proof-of-concept webserver uses three tables—routes, visits, and presses—to manage the website, routing, and visitor logs entirely within its own SQLite file.

    All state is updated in the same SQLite file as the program itself

  4. Redeployment acts as data migration.

    Updating a program becomes a matter of swapping the file and performing INSERT ... SELECT operations to migrate data between the old and new executable versions.

    the migration is two INSERT ... SELECT, because the program and its data are the same file!

  5. SQLite provides free machinery.

    Programs inherit existing capabilities like ACID transactions, full-text search via FTS5, and auditing via sqldiff without writing new logic.

    It is machinery SQLite already has, that a program inherits for free

Read the original ↗Save to your Sponge

Summarized with Sponge. Quotes are the author’s own words.

More from @bg

All readings →