Making Atuin sync 32x faster with packfiles
Atuin upgraded its shell history synchronization to be up to 32x faster using Git-inspired encrypted packfiles, request pipelining, and batched SQL inserts.
read it It offers a concrete, highly technical postmortem on optimizing synchronization protocols for end-to-end encrypted data.
summary
Atuin redesigned its synchronization engine to overcome the performance bottleneck of end-to-end encrypted shell history records. Because encrypted payloads are indistinguishable from noise and uncompressible by servers, the client now bundles records into zstd-compressed, PASETO-encrypted packfiles before uploading. Combined with download pipelining and batched SQL inserts, the new approach reduces sync times for power users from minutes to single-digit seconds.
key points
- Clients bundle records into zstd-compressed and PASETO-encrypted packfiles because end-to-end encryption prevents server-side compression.
- Request pipelining alone yielded a 340% performance improvement.
- The new architecture reduces power-user sync times from over five minutes to under ten seconds.
who should read it
Systems engineers and developers interested in sync protocols, client-side encryption, and performance optimization.
discussion positive
consensus
Commenters appreciate the performance gains and practical software evolution, discussing whether massive speedups reflect iterative growth or initial design flaws.
pushback
A few users question the need for cloud sync for shell history compared to simple local files or version control systems.
Atuin maintaner here!
It definitely would, but the real challenge is twofold:
- Atuin does real-time sync, meaning that anything you do locally gets reflected near-instantly on any other machine you have. - Atuin does end-to-end encryption, which means that we actually need to do an absurdly larger amount of work compared to an rsynced histfile in order to get your history in a format that's locally decrypted.
Certainly, these things are possible with a VCS, but I suspect that meeting these two criteria with an rsynced encrypted file would land on more-or-less the same performance …
The maintainer provides authoritative context on why the encryption model and real-time requirements make naive file synchronization insufficient.
Generated by an LLM from the article and thread. Check the sources before relying on it.