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

Feature request: a way to know what things changed #204

Open
dead-claudia opened this issue Oct 17, 2024 · 1 comment
Open

Feature request: a way to know what things changed #204

dead-claudia opened this issue Oct 17, 2024 · 1 comment

Comments

@dead-claudia
Copy link

I'm thinking this could be as simple as the following:

  • Provide a "tag" that updates when any prefix updates.
  • Get a list of 5-letter prefixes that changed

From a backend perspective, you could avoid expensively iterating all 2^20 entries on every single request when the function's hot by doing something like this:

  • For the "tag", return a monotonically increasing counter, incremented by at least 1 on change. The important thing is that older tags come before newer tags.
  • For the data, it could just live in a prefix -> tag table, along with a record for "current tag". This current tag, along with the whole table, could be cached and stored in an array sorted by tag (and optionally then by prefix).
    • If Azure Functions only allows function instances to process one request at a time, the sorted array can be generated on ingest and just read by the querying function. (I don't know if Azure Functions works this way, but I know AWS Lambda does.)
  • Results returned would just be a matter of finding the first prefix in the array with a given tag >= the one provided, and returning every prefix from that one on.
@dead-claudia
Copy link
Author

Let me know if anything needs clarified.

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