Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

feat(example): loyalty service #77

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/airline/digital/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Digital

Book a flight from the website

- Digital stitches GraphQL queries of the route schedule (from scheduling) with seat availability (from reservations)
- Digital creates a reservation with Reservations (graphql mutation)
- Digital creates a payment intent with Revenue (graphql mutation)
- The payment clears (from Stripe or something) and Revenue emits an event
- Reservations receives a payment event from Revenue and declares the reservation confirmed
- Digital sends an email to the customer after receiving the reservation confirmed event
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Feature: Distributed systems problems

We should provide examples for dealing with the following problematic situations...

Rule: At least once delivery should not break idempotency
Example: Policy receives event twice
Example: Read model receives event twice
Example: Command issued twice is rejected
# Use an idempotency token

# We cannot control the
Rule: Out of order events
Example: Read model projection recieves external events in an unexpected order
Example: Events originating within the same bounded context are ordered

Rule: Event replay
Example: New read model needs to "backfill"
start filling read model queue with live events but do not begin processing them
begin processing historical events in order
once the newest historical event processed is older than the oldest live event in the queue begin processing live events
skip events you've already seen
Example: Pre-existing read model needs to re-build its model?

Rule: Race condition
Example: Command with optimistic concurrency
Example: Command with no concurrency (last write wins, duplicates ok)

Rule: Saga
Example: Distributed, long running transaction

Rule: Eventual consistency too slow with high data volume
Example: Lambda architecture
Loading