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

changes deployment manifest to use statefulset #34

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

vroldanbet
Copy link
Contributor

@vroldanbet vroldanbet commented Sep 19, 2023

Closes #18
Closes #17

Partially supports #7

With the usage of go-workflows, which we have currently configured with SQLite, we will need some durable persistence for the database WAL.

This PR changes the manifest to use a StatefulSet with 2 replicas for now to demonstrate that state distributed across replicas should be fine for this use case. It also adds a volumeClaimTemplate for the database storage.

What's the deal with durability and HA

This project is currently configured to persist workflow state to a local SQLite. It turns out having multiple replicas with their own local SQLite databases should be fine because the workflows are engineered to be idempotent and SpiceDB and Kube API server act as the source of truth.

If 2 replicas ended up receiving the exact same request (e.g. a client-side retry), two different go-workflow instances with their own SQLite will be executing a workflow. If activities from one instance interleave with those from another instance, the individual activities will be coordinated with the state of the backing SpiceDB/Kube API server.

So for all intent and purposes, durability and high-availability for the MVP will be addressed by:

  • using persistent volumes for SQLite WAL
  • having multiple replicas with their own independent SQLite WALs, which should be fine

With the usage of go-workflows, which we have
currently configured with SQLite, we will need
some durable persistence for the database WAL.

This PR changes the manifest to use a StatefulSet
with 2 replicas for now to demonstrate that
state distributed across replicas should be fine
for this use-case. It also adds a volumeClaimTemplate
for the database storage.
@ecordell ecordell merged commit 5d9721a into main Sep 19, 2023
6 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

durable workflow data highly available proxy
2 participants