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

Use eventual consistency to update EntityList num_entities #2651

Merged
merged 63 commits into from
Sep 16, 2024

Conversation

kelvin-muchiri
Copy link
Contributor

@kelvin-muchiri kelvin-muchiri commented Jul 25, 2024

Changes / Features implemented

Use eventual consistency to update EntityList num_entities in the database. Store counter in the cache and add a task that should be run periodically to persist the counter in the database.

Add a failover mechanism to persist cached data in the database incase the periodic task is not running or has malfunctioned.

Steps taken to verify this change does what is intended

  • QA
  • Tests

Side effects of implementing this change

Less load on the database to update num_entities

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation

Closes #

@kelvin-muchiri kelvin-muchiri force-pushed the el-num-entities-eventual branch 2 times, most recently from 888ad16 to a8f3593 Compare July 30, 2024 10:18
@kelvin-muchiri kelvin-muchiri marked this pull request as ready for review August 5, 2024 09:27
@kelvin-muchiri kelvin-muchiri marked this pull request as draft August 8, 2024 07:49
@kelvin-muchiri kelvin-muchiri marked this pull request as ready for review September 6, 2024 11:04
@faith-mutua
Copy link

@kelvin-muchiri this is working as expected, the count in the Entity List is incremented correctly when multiple entities are submitted concurrently. The count also decrements correctly when entities are deleted from the Entity List

ukanga
ukanga previously approved these changes Sep 13, 2024
@kelvin-muchiri kelvin-muchiri merged commit 1f4dd18 into main Sep 16, 2024
10 checks passed
@kelvin-muchiri kelvin-muchiri deleted the el-num-entities-eventual branch September 16, 2024 07:04
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

Successfully merging this pull request may close these issues.

4 participants