Open davydovanton opened 6 years ago
@davydovanton I imagine Redis doesn't also have a process identifier because it can maintain the sequence number in one place. When maintaining a sequence across multiple processes, it's a little more tricky and at least could require an identifier for the process as well.
However, I'd looked for a GUID/UUID format that incorporated a timestamp and randomness. ULID is what I found and think would be a great solution to adopt as a default UUID. It has a timestamp prefix followed by random entropy. Formatted as a UUID with specific characters (not hex), it can also be converted to a big int.
Check out ULID (Ruby implementation): https://github.com/abachman/ulid-ruby
Thoughts?
P.S. ULID can also help make SQL indexes faster by having some sequence to the IDs via the timestamp prefix in the ULID
@joelvh hey, thanks for your ideas 💯
I think, for the first iteration, we can use SecureRandom.hex
for this (like a in sidekiq).
For me, the general idea of "eid" (Event ID) is better logging, that's why we can use not uniq way now. In future we can create a way for adding custom id functions 🤔
@davydovanton got it - makes sense. I'm also coming more from the UUID-as-identifier perspective and thinking of Event Sourcing, but Hanami Events is more transient events for coordination rather than state.
yep, agree with you. that's why I suggest to create a simple solution before and understand what we need :)
@davydovanton what was the reasoning not to use Wisper with custom broadcaster?
I created simple backlog for this feature. will work on it
We want to see simple way for debugging events, that's why we need to use sequences for each adapter type and generate
event_id
. For example:Backlog
meta
keyword in subscribe block for getting eidEvent type
I really love idea from redis streams:
That's why, let's create event id as
time.seq