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

Persistence notifiers #575

Open
alexandrosfilios opened this issue May 23, 2024 · 0 comments
Open

Persistence notifiers #575

alexandrosfilios opened this issue May 23, 2024 · 0 comments
Assignees

Comments

@alexandrosfilios
Copy link
Contributor

alexandrosfilios commented May 23, 2024

Currently, in order to subscribe to transaction status changes, we need to add a listener to the commit pipeline. Then every time a FSC node commits a transaction, this will also trigger all subscribers. However, for replicated nodes, only one of them will successfully commit the transaction, and all others will not be notified. Hence, all functionality that depends on these notifications will not be triggered. As a more generic solution, we can have notifiers for any type of table by extending the persistence interfaces with two methods:

// Subscribes to delete's, insert's and update's of column fields
Subscribe(callback func(operation string, values map[string]string)) error
// Unsubscribes the listener
Unsubscribe() error

Since we have multiple persistence implementations, these will have to be supported for the following:

  • Memory
  • Badger
  • Sqlite
  • Postgres

For the first 3 cases, the approach will be similar to the current approach, where after each commit operation we also call a notifier. This approach will work, because these implementations do not support replication anyway. For the Postgres case, we need to use the Postgres notifiers, so that also all other replicas receive the notification.

@alexandrosfilios alexandrosfilios self-assigned this May 23, 2024
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