When events are delivered to systems that want to process them in order but also concurrently, there needs to exist a mechanism to tell which events are related to the same object (and thus need to be processed one after another), and which ones are unrelated (and thus can be processed at the same time).
A typical use case is delivering messages to an ordered Google Pub/Sub queue or an SQS FIFO queue as those have built-in support for ordering keys and ordered processing. A less obvious case is delivery to an HTTP endpoint that then relays the message to a system that implements ordered processing.
1. General Assumptions
Every async event should have an ordering key. Events related to the same object should share the same ordering key, preferably the GraphQL ID of the object (or, even better, a combination of Saleor's PUBLIC_URL and the object ID in case a system was to process events from multiple Saleor instances, which will definitely happen for some payment apps).
Acceptance Criteria
Each EventDelivery contains an ordering key
Each EventDelivery related to the same order, product, variant, etc. has the same ordering key
The Event interface in the GraphQL API makes it possible to retrieve the ordering key
Google Pub/Sub events have the ordering key set on the protocol level
AWS SQS events have the ordering key set on the protocol level
Problem
When events are delivered to systems that want to process them in order but also concurrently, there needs to exist a mechanism to tell which events are related to the same object (and thus need to be processed one after another), and which ones are unrelated (and thus can be processed at the same time).
A typical use case is delivering messages to an ordered Google Pub/Sub queue or an SQS FIFO queue as those have built-in support for ordering keys and ordered processing. A less obvious case is delivery to an HTTP endpoint that then relays the message to a system that implements ordered processing.
1. General Assumptions
Every async event should have an ordering key. Events related to the same object should share the same ordering key, preferably the GraphQL ID of the object (or, even better, a combination of Saleor's PUBLIC_URL and the object ID in case a system was to process events from multiple Saleor instances, which will definitely happen for some payment apps).
Acceptance Criteria
2. API changes
Types
3. Database changes
4. UML diagrams
5. To Do list