Skip to content

orbitinghail/sqlite-delta

sqlite-delta

Lightweight CDC patterns for SQLite


sqlite-delta is a collection of tested change-data-capture (CDC) patterns for SQLite databases. This repository is educational - the patterns are designed to be studied, understood, and adapted for your specific use case rather than used directly in production.

The provided implementations serve as working examples with comprehensive tests to demonstrate the concepts. Users should read and understand the patterns, then re-implement them in their own codebase tailored to their specific tables and requirements.

Patterns

  • trigger-lite: keep track of changed rows since the last diff, requires all tables have a rowid.
  • three-phase: triple-buffer rows in a table to enable delta compression with minimal extra data movement.

Glossary

  • Changeset: A Changeset is a set of operations which encode the difference between two versions of a SQLite database or table.
  • Checkpoint: A canonical full dump of a SQLite database or table.

Dependencies

To run scripts and tests in this project, you'll need to install uv. Then run the following command to install all dependencies:

uv sync

Acknowledgments

This project was developed in collaboration with Shapr3D. Special thanks to:

  • Richárd Szabó - Collaborated on the design of the trigger-lite and three-phase patterns
  • Dávid Mentler - Collaborated on the design of the trigger-lite and three-phase patterns

Contributing

Thank you for your interest in contributing your time and expertise to the project. Please read our contribution guide to learn more about the process.

License

Licensed under either of

at your option.

About

Lightweight CDC patterns for SQLite

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Contributors 5