otto-de / api-guidelines

A set of rules to build consistent and high quality REST and Async APIs at OTTO.
https://api.otto.de/portal/guidelines
Creative Commons Attribution 4.0 International
47 stars 12 forks source link

[new rule] must use `partitionkey` context attribute (CloudEvents) #15

Open BirgitBader opened 1 year ago

BirgitBader commented 1 year ago

(i) This issue has been manually transferred from a former internal repository, as a private repository issue cannot be transferred to a public repository.

Context

Many transport use partitioning as a way to perform scaling (see https://www.instaclustr.com/blog/the-power-of-kafka-partitions-how-to-get-the-most-out-of-your-kafka-cluster/).

As a CloudEvent may be passed between multiple intermediaries before being consumed, the intermediaries need to have a way to partition event streams to scale efficiently.

The partition extension provides a common way to provide a context attribute containing the partition key.

A typical partitionkey for events originating from one source is the source-id. Depending on the business case, the partitionkey may also be something else.

BirgitBader commented 1 year ago

Comment history

Apr 20, 2022 by @thake

On second thought using this extension should not be part of the MVP. The MVP concentrates on the usage of kafka as a transport. Kafka records inherently have a partitionkey, therefore this rule is not needed in the MVP.