Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SQLite changesets as a change mechanism #1338

Open
otoolep opened this issue Jul 11, 2023 · 1 comment
Open

Support SQLite changesets as a change mechanism #1338

otoolep opened this issue Jul 11, 2023 · 1 comment

Comments

@otoolep
Copy link
Member

otoolep commented Jul 11, 2023

Instead of writing directly to the database, perhaps something like this;

  • Received SQL statement on the /db/execute endpoint.
  • start a transaction on the rw connection to the database
  • start a session, and apply the SQL statement as changeset.
  • record the changeset
  • rollback the transaction
  • encapsulate the changeset bytes in a Raft log, and send it through the Raft consensus system as usual
  • each node gets the Raft log entry, recognizes it's a changeset, and applies it.

Boom, rqlite can handle non-deterministic change. No more concerns about RANDOM, TIMESTAMP, and AUTOINCREMENT.

@otoolep
Copy link
Member Author

otoolep commented Jul 11, 2023

This might be useful, as mattn/sqlite doesn't have direct support:

https://github.com/crawshaw/sqlite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant