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

Size Constraints #405

Merged
merged 3 commits into from
Jun 6, 2019
Merged

Size Constraints #405

merged 3 commits into from
Jun 6, 2019

Conversation

clemensv
Copy link
Contributor

This is an alternate proposal for #395 and #364 which states a simple 64 KByte "should" wire-size limit for publishers and for consumers along with guidance to refer to large data items instead of including them,

Signed-off-by: Clemens Vasters clemensv@microsoft.com

@rperelma
Copy link
Contributor

I vastly prefer this approach to the others. 👍

Copy link
Contributor

@JemDay JemDay left a comment

Choose a reason for hiding this comment

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

I think everybody will prefer the simplicity of this kind of statement but i think we ended up going down the other rabbit-holes because we thought more specificity was needed.

Whatever we do i think it'd help to have a compliance test, maybe leveraging our SDKs, that can be used to assert the 64K boundary condition.

spec.md Outdated
encoding for an event used by the application SHOULD be considered for
compliance with this size constraint.

A consumer or intermediaries MAY refuse to accept events that exceed an
Copy link
Contributor

Choose a reason for hiding this comment

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

s/intermediaries/intermediary/

spec.md Outdated
of events, because the referenced external data items allow for differentiated
access control to sensitive details.

The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we re-word this more along the lines of _"... CloudEvent intermediaries MUST be capable of transporting and delivering CloudEvents with a wire-size of 64 KByte.." - we're not looking to limit the size and i believe SHOULD NOT is a bit of a strong statement.

Copy link
Contributor

@cneijenhuis cneijenhuis left a comment

Choose a reason for hiding this comment

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

A personal note first: I am sorry that the following dismissal sounds rather harsh. I have invested significant amount of time in trying to build a consensus in the workgroup, also based on feedback from Clemens. I think I have made it clear that I'm willing to compromise on virtually anything, except for a guarantee of interoperability for event producers. #395 is based on the feedback of the workgroup over several months and has significantly changed compared to my original PR.

I wish we could have resolved this in the previous workgroup meetings, and I am also more than willing to take back my PR if Clemens proposal would guarantee interoperabilty.


This proposal does not ensure interoperability between different encodings and transport formats: An event producer may not know which encodings and transports will be used for their events, and they may not implement those.

This proposal is simpler to implement for those that want to limit the wire-size to exactly 64KB. The only middleware that qualifies is Azure EventGrid. Every other tech stack we looked at (see #257) has higher limits (e.g. 256KB or 1MB).

Additionally, this proposal goes against a previous decision by the workgroup against a size constraint.

spec.md Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Constraints
Copy link
Contributor

Choose a reason for hiding this comment

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

As I have pointed out on last weeks call, the workgroup already discussed whether we should have a size constraint, or a size guarantee. On Jan 17, the workgroup decided that we want to go with a size guarantee, and not with a constraint.

If you don't tryst my comments in the PR, feel free to listen to the recording of the call.


One of the reasons is that 64 KB is the lowest common denominator due to Azure EventGrid. All other tech stacks we looked at supported higher wire sizes, and members of the workgroup still want to use larger events if they know their tech stack supports it without violating a SHOULD.

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps Minimum Supported Size or CloudEvent Size?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Size Constraints
# Size Guarantee

Copy link
Contributor

Choose a reason for hiding this comment

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

The suggestion above is still valid.

spec.md Outdated
If an application configuration requires for events to be routed across different
transports or for events to be re-encoded, the least efficient transport and
encoding for an event used by the application SHOULD be considered for
compliance with this size constraint.
Copy link
Contributor

Choose a reason for hiding this comment

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

Practically, if the least efficient transport is:

The first case was not acceptable to you, and you have requested that #364 is changed to not force event producers to serialize events to JSON if they are using a different encoding. I am wondering what suddenly changed your mind?

The second case is significantly worse for the event producer. JSON must be implemented, so the event producer can easily measure the size. For anything else, there is no guarantee the event producer has it implemented.

My main motivation for this whole effort is to enable event producers that will be part of a huge number of applications and tech stacks (examples: GitHub, PayPal, Twilio, ...) to be confident their events will be accepted by any event consumer, independently of what is used on the wire. This proposal does not achieve it.

@duglin
Copy link
Collaborator

duglin commented Mar 22, 2019

Copy link
Member

@erikerikson erikerikson left a comment

Choose a reason for hiding this comment

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

nits

spec.md Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Constraints
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps Minimum Supported Size or CloudEvent Size?

@@ -288,6 +289,31 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Constraints

Copy link
Member

Choose a reason for hiding this comment

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

It might be nice to start with the requirements in a compact/clear declaration followed by the explainer text. Seek time is high as written.

Perhaps

The size of an event is its wire-size.  Wire-size includes every bit that is transmitted on the wire: transport frame-metadata, event metadata, and event data.

* Consumers MUST accept events up to 64KM in size.
* Consumers MAY reject any event over 64KB in size.

Perhaps MUST should be SHOULD to allow for compliant low memory footprint consumers but my expectation is that such circumstances would be fairly narrow and would reduce the value of this section.

spec.md Outdated

The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This
includes the frame-metadata of the chosen transport and all event metadata and
event data, regardless of encoding.
Copy link
Member

Choose a reason for hiding this comment

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

nit: s/the frame-metadata of the chosen transport and all event metadata and event data/the frame-metadata of the chosen transport, all event metadata, and event data/

@duglin
Copy link
Collaborator

duglin commented Mar 22, 2019

rebase needed

Copy link
Contributor

@cneijenhuis cneijenhuis left a comment

Choose a reason for hiding this comment

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

As discussed

spec.md Outdated
of events, because the referenced external data items allow for differentiated
access control to sensitive details.

The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This
CloudEvent intermediaries MUST be capable of transporting and delivering CloudEvents with a wire-size of 64 KByte.

(Jems suggestion)

Suggested change
The overall wire-size of a published event SHOULD NOT exceed 64 KByte. This
All CloudEvent consumers SHOULD accept events with an overall wire-size of 64 KByte.

Sounds similar to my PR.

spec.md Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Constraints
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Size Constraints
# Size Guarantee

@duglin
Copy link
Collaborator

duglin commented May 2, 2019

@clemensv rebase needed, and I think you were going to make some editoral tweaks.

@clemensv clemensv force-pushed the event-size-quota branch from 24ab19b to 740be10 Compare May 8, 2019 13:44
@duglin
Copy link
Collaborator

duglin commented May 9, 2019

I think the rebase did some funky stuff -for example, the new version number is reverted and the new "required attributes" header section is gone.

@duglin
Copy link
Collaborator

duglin commented May 10, 2019

ping @clemensv to check the rebase - see the previous comment

@duglin
Copy link
Collaborator

duglin commented May 15, 2019

Ignoring the rebase needed, and just focusing on the text in the "Size Constraints" section - this LGTM and is aligned with what the group agreed to in a previous call.

Copy link
Contributor

@cneijenhuis cneijenhuis left a comment

Choose a reason for hiding this comment

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

@duglin Asked me to make my usual comments for the third time, because on last weeks call, multiple people found the constraint-enforcement (or kinda-enforcement via SHOULD) odd.

As discussed previously, these issues don't arise if we focus on a size guarantee from intermediaries.

spec.md Outdated
@@ -288,6 +289,31 @@ encapsulated within the `data` attribute.
* Constraints:
* OPTIONAL

# Size Constraints
Copy link
Contributor

Choose a reason for hiding this comment

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

The suggestion above is still valid.

spec.md Outdated
transport and encoding used by the application SHOULD be considered for
compliance with these size constraints:

- Publishers SHOULD NOT publish events exceeding a size of 64 KByte.
Copy link
Contributor

Choose a reason for hiding this comment

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

This line should be removed.

@duglin
Copy link
Collaborator

duglin commented May 27, 2019

@clemensv rebase needed and there are some outstanding questions from @cneijenhuis

Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
@clemensv clemensv force-pushed the event-size-quota branch from 740be10 to fc7b84e Compare June 4, 2019 13:09
@clemensv
Copy link
Contributor Author

clemensv commented Jun 4, 2019

I redid the commit because I messed up that branch. To address @cneijenhuis' comments, I now call the section "Size Limits" (I find "Guarantees" too strong) and I also removed the statement about the Publisher as suggested. What's left is that intermediaries MUST forward 64KB and that consumers SHOULD be able to deal with 64KB.

@duglin duglin removed the needs work label Jun 4, 2019
Copy link
Member

@erikerikson erikerikson left a comment

Choose a reason for hiding this comment

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

I appreciate the intent of introducing a distinction between intermediaries and consumers here. It seems that you are introducing a new dimension that could and perhaps should impact the whole specification. Doing so in the scope of this PR rather than as a separate and comprehensive PR doesn't seem like the right approach. Otherwise, I offer a few nits and point out language where it doesn't appear you've written what you intend.

spec.md Outdated
transport and encoding used by the application SHOULD be considered for
compliance with these size constraints:

- Intermediaries MUST forward events of a size of at least 64 KByte.
Copy link
Member

Choose a reason for hiding this comment

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

Although I believe I understand your intent, this technically only creates a requirement for events of "at least 64 KByte" or in other words, events with a size that is 64KB or more. As such, as written it doesn't discuss events of the smaller size but worse, it specifies that all events 64KB or larger MUST be forwarded by intermediaries.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@erikerikson can you suggest some alternate wording?

Copy link
Member

Choose a reason for hiding this comment

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

My original recommendation was offered in a previous [comment] (#405 (comment)) but new framing has been developed which is good. I'll attempt to make a suggestion in the next few days.

Copy link
Collaborator

Choose a reason for hiding this comment

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

.... of a size of 64 KBytes or less.

spec.md Outdated
embedded devices, that are storage or memory-constrained and therefore
would struggle with large singular events.

The "size of an event" is it's wire-size, and includes every bit that is
Copy link
Member

Choose a reason for hiding this comment

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

NIT: I believe size is the term here. I think only that should be quoted.

spec.md Outdated
- Intermediaries MUST forward events of a size of at least 64 KByte.
- Consumers SHOULD accept events of a size of at least 64 KByte.

In effect, these rules will allow events of up to 64 KByte to be published
Copy link
Member

Choose a reason for hiding this comment

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

Consider In effect, these rules will allow producers to publish events up to 64KB in size safely. Safely here means that it is generally reasonable to expect the event to be accepted and retransmitted by all intermediaries.

@clemensv
Copy link
Contributor Author

clemensv commented Jun 6, 2019

@erikerikson

  1. "Intermediary" and "consumer" are terms explicitly defined in the spec in the roles that I use here, so this isn't adding anything new.
  2. "At least 64KByte" sets a lower boundary for what an intermediary MUST be able to handle, and that is the exact intent. An intermediary is conformant if it allows for exactly 64KByte, because that satisfies "at least".
  3. Yes, you are correct about only "size" needing quotes and there's also an it's/its mixup. Will fix that.
  4. I'll merge your proposal, while leaving the consumer statement.

Clemens Vasters added 2 commits June 6, 2019 09:09
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
Signed-off-by: Clemens Vasters <clemensv@microsoft.com>
@duglin
Copy link
Collaborator

duglin commented Jun 6, 2019

Approved on the 6/6 call with the minor wording change in the latest commit ( b723e49 ).

@duglin duglin merged commit 9d54ab2 into cloudevents:master Jun 6, 2019
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 this pull request may close these issues.

6 participants