complected and orthogonal persistence
a day ago
- Persistence is difficult to implement; for example, autobackup in editors requires serializing data structures to a crash-consistent database.
- Some languages like MUMPS, Bank Python, and IBM i integrate persistence directly into the language runtime, making it part of the syntax.
- Complected persistence ties business logic and persistence code together, while orthogonal persistence saves state automatically without programmer effort.
- Examples of orthogonal persistence include system hibernation and virtual machine snapshots (e.g., VirtualBox, VMWare).
- A proposed system uses existing tools (rr for syscall replay, ZFS for filesystem snapshots, bubblewrap for sandboxing) to provide orthogonal persistence for individual processes.
- This system enables many tools: collaborative terminals, undo for terminal commands, querying files modified by a command, and live-editable recordings.
- Performance is manageable: rr has <20% slowdown, ZFS and bubblewrap have minimal overhead, and the system can be optimized.
- Inter-process persistence works across program versions if syscalls are replayed, but memory snapshots are version-specific.
- Orthogonal persistence is achievable today with moderate trade-offs and unlocks many powerful tools with minimal development effort.