dwyl / alog

🌲 alog (Append-only Log) is an easy way to start using the Lambda/Kappa architecture in your Elixir/Phoenix Apps while still using PostgreSQL (with Ecto).
GNU General Public License v2.0
15 stars 2 forks source link

UUID as entry_id ? #15

Open nelsonic opened 5 years ago

nelsonic commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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