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

tracking: use ULIDs for KV-related logic #476

Closed
3 tasks done
iuioiua opened this issue Sep 1, 2023 · 0 comments · Fixed by #514
Closed
3 tasks done

tracking: use ULIDs for KV-related logic #476

iuioiua opened this issue Sep 1, 2023 · 0 comments · Fixed by #514
Assignees
Labels

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Sep 1, 2023

With ULIDs, we could do the following:

  • Remove the need for *_by_time KV indexes
  • Remove the need for createdAt properties
  • Maintain chronological order of entries in lists

Todo:

@iuioiua iuioiua added the v1 label Sep 1, 2023
@iuioiua iuioiua self-assigned this Sep 1, 2023
iuioiua added a commit that referenced this issue Sep 8, 2023
Please pay attention to the migration script, as it's responsible for
migrating all items and votes. I've also changed all instances of
`monotonicUlid()` to `ulid()` at there appears to be a bug that prevents
`monotonicUlid()` from respecting the `seedTime` parameter.

The migration can be simulated as follows:
1. Switch to **main** branch.
2. Run `deno run db:reset`.
3. Run `deno run db:seed`.
4. Run `deno task start` and navigate to `http://localhost:8000`.
6. Vote some items.
7. Note the voted items and the order of the items feed.
8. Switch to **ulid-items** branch.
9. Run `deno run db:migrate`.
10. Run `deno task start` and navigate to `http://localhost:8000`.
11. Check that the voted items and the order of the items feed are
identical to those previously noted.

Closes #475
Closes #476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant