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

Data deletion endpoints and Acoustic sync #756

Closed
leplatrem opened this issue Jul 11, 2023 · 0 comments
Closed

Data deletion endpoints and Acoustic sync #756

leplatrem opened this issue Jul 11, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@leplatrem
Copy link
Contributor

leplatrem commented Jul 11, 2023

This issue is strongly related with the following ones:

Context and Problem Statement

The PUT and DELETE endpoints of the API allow to delete data from the database. And with the current model, the Acoustic sync service does not have anyway to detect them.

We want to avoid situations where data was deleted from CTMS and still persists in Acoustic (see https://mozilla-hub.atlassian.net/browse/CTMS-146)

Decision Drivers

  • Complexity: Low → High: how complex is the solution
  • Cost: Low → High: how much engineering efforts is required
  • Robustness: Low → High: how resilient to failures

Considered Options

  1. [option 1]
  2. [option 2]
  3. [option 3]

Decision Outcome

Chosen option: "[option 1]", because [justification. e.g., only option, which
meets k.o. criterion decision driver | which resolves force force | … | comes
out best (see below)].

Pros and Cons of the Options

Option 1 - Restrict destructive endpoints

Cost: Mid, because it requires some development
Complexity: Low
Robustness: Low, because there could still be situations where admins delete contacts from the DB and don't delete them in Acoustic

Option 2 - Remove the PUT endpoint

Replacing data would only be doable via PATCH requests (specifying all fields to be overwritten)

Cost: Low
Complexity: Low
Robustness: Low, same as option 1. The DELETE endpoint could still lead to inconsistencies.

Option 3 - Implement a sync queue

See #571 (comment)

Cost: Mid-High, because it requires some development
Complexity: Low, because it is a common pattern. And it would probably simplify the sync code.
Robustness: High, because every entry in the sync queue would be added/removed using DB transactions.

Option 4 - Sync by uploading CSVs

Export the DB content every X hours, and have scheduled ingestion jobs on Acoustic.

Cost: Low
Complexity: Low, because we could get rid of sync code
Robustness: Mid, because it relies on Acoustic, but not High because we would not have monitoring of the csv ingestion

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

No branches or pull requests

1 participant