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

UUID as entry_id ? #15

Open
nelsonic opened this issue Nov 1, 2018 · 2 comments
Open

UUID as entry_id ? #15

nelsonic opened this issue Nov 1, 2018 · 2 comments
Labels
discuss help wanted Extra attention is needed question Further information is requested starter technical

Comments

@nelsonic
Copy link
Member

nelsonic commented Nov 1, 2018

At present we are using a Random UUID for entry_id

entry_id: Ecto.UUID.generate()

see: /lib/alog.ex#L269

This is good in that it is "globally unique".
But is it the most effective unique ID we could be using?

@njwest
Copy link

njwest commented Mar 22, 2019

Thanks for this phenomenal append-only log example!

PostgreSQL has a UUID type that only takes up 16 bytes (much less than UUID as string) and is supported by Ecto:

Migration:

add :entry_id, :uuid

Schema:

field :entry_id, Ecto.UUID

Was string chosen for UUID storage for a particular reason?

@nelsonic
Copy link
Member Author

@njwest thanks for sharing. I hadn’t spotted the PgSQL UUID Type. Good to know. 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss help wanted Extra attention is needed question Further information is requested starter technical
Projects
None yet
Development

No branches or pull requests

2 participants