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

Optional event id #422

Closed
wants to merge 6 commits into from
Closed

Conversation

alanconway
Copy link
Contributor

See discussion at issue #326.
This PR is base on pR #391 as it depends on those changes.

alanconway and others added 6 commits April 24, 2019 14:59
Reword "id" uniqueness description.

Signed-off-by: Alan Conway <aconway@redhat.com>
…queness.

Signed-off-by: Alan Conway <aconway@redhat.com>
Signed-off-by: Alan Conway <aconway@redhat.com>
Co-Authored-By: alanconway <aconway@redhat.com>
Signed-off-by: Alan Conway <aconway@redhat.com>
Signed-off-by: Alan Conway <aconway@redhat.com>
See discussion at issue cloudevents#326.
This PR is base on pR cloudevents#391 as it depends on those changes.
@alanconway alanconway changed the title Optional Optional event id Apr 24, 2019
- MUST be a non-empty string
- MUST be unique within the scope of the producer
- OPTIONAL
- Producers MAY omit `id` if de-duplication is not required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Design Goal section states:

CloudEvents are typically used in a distributed system to allow for services to be loosely coupled during development, deployed independently, and later can be connected to create new applications.

In a loosely coupled system, a producer can't tell if de-duplication is not required (otherwise they're strongly coupled), and even if it could - can the producer tell that if it is later connected to create a new application, de-duplication won't be required in the future?

@alanconway
Copy link
Contributor Author

alanconway commented Apr 29, 2019 via email

@cneijenhuis
Copy link
Contributor

In an application where consumers need the latest thermostat reading [...]

This is exactly what the Design Goal section talks about. The producer makes an optimization-decision on what the application will be. By doing so, the producer can limit itself to "be later connected to create new applications." There is no guarantee that there won't be another application that isn't interested in the latest thermostat reading, and would actually need to de-duplicate events.

I've learned this lesson the hard way. Whenever I tried to be smart and optimize, because "there will never be a use case for that", a few months (or sometimes years) later a valid use case for it pops up.

CloudEvents has, for me, the strongest selling point when we're talking truly loosely coupled system - e.g. I buy something from vendor Foo, something from vendor Bar, and then I also consume events from my cloud provider Baz. Of course, CloudEvents is also nice when I use it for my internal services only, but that problem-space is already handled not-too-badly with existing tools. The cross vendor use cases really are more painful atm.

@clemensv
Copy link
Contributor

clemensv commented May 2, 2019

I've read up on #326 and while I like @alanconway's line of argumentation about the IDs being optional in AMQP and MQTT, I don't think that necessarily means that the ID also needs to be optional in CloudEvents, because CloudEvents is an application of MQTT or AMQP or HTTP (etc) and therefore a layer further up. I agree with @cneijenhuis and the current state of the spec that each event should be uniquely identifiable and that there needs to be an interoperable and unambiguous criterion for determining that identity, which is the id.

@jric argues that the timestamp might be sufficient together with source and type, but timestamps are iffy because of timer resolution and because systems clocks do reset backwards when compensating for skew or, for instance, when a container wakes up on a new host.

We shouldn't limit the considerations to deduplication, but also think about archiving events in database systems where you also need some uniqueness criterion.

@alanconway
Copy link
Contributor Author

alanconway commented May 2, 2019 via email

@duglin
Copy link
Collaborator

duglin commented May 2, 2019

We shouldn't limit the considerations to deduplication

+1 This is the part of the discussion that has been kind of bothering me. We seem to be very focused on dedup these days (here and for #391 ) and I think ID uniqueness has other uses beyond dedup and I'm worried that making it optional means that people will need to find some other (non-interoperable) solution that they can count on, and that will turn our optional ID into something useless. Which at that point we might as well just remove it from the spec.

To @alanconway's point about the usecases where uniqueness checks of any kind are not needed, I can think of a couple of other choices, just to put out some other ideas to consider:

  • make ID required but make it STRONGLY RECOMMENDED that it be unique (rather than a MUST)
  • make ID optional, but make it STRONGLY RECOMMENDED that it be included and even add text that says we only made it optional for edge cases where generating a unique ID is just not possible.

@duglin
Copy link
Collaborator

duglin commented May 2, 2019

@alanconway can you join today's call? it's at 1pm ET

@alanconway
Copy link
Contributor Author

alanconway commented May 2, 2019 via email

@clemensv
Copy link
Contributor

clemensv commented May 3, 2019

@alanconway in the kinds of pub/sub systems we've been discussing in the group so far, the publisher generally doesn't know about the consumer(s)/subscriber(s) and therefore it doesn't know about the subscriber's application design. A single event may reach multiple applications, each with a different design, and a new subscriber might require unique identification of events whereas existing subscribers yet do not.

@alanconway
Copy link
Contributor Author

alanconway commented May 3, 2019 via email

@duglin
Copy link
Collaborator

duglin commented May 8, 2019

@alanconway we discussed this on last week's call and there was general agreement to keeping it required. However, we didn't want to close it until you had a chance to join the call this week (tomorrow) to make a case for making it optional. Can you join the call to discuss this?

@alanconway
Copy link
Contributor Author

I will let this one go, and live to fight another day. I couldn't make the call but it's on my calendar now for the next time I want to cause trouble.

@alanconway alanconway closed this May 9, 2019
@duglin
Copy link
Collaborator

duglin commented May 10, 2019

@alanconway thank you for your patience on this one - and yes please do keep "causing trouble" :-)

@alanconway
Copy link
Contributor Author

alanconway commented May 10, 2019 via email

@alanconway alanconway deleted the optional-id branch June 13, 2019 15:50
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

Successfully merging this pull request may close these issues.

5 participants