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.
- 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.
- 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.
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
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
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.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.