WEBVTT

1
00:00:00.000 --> 00:00:02.420
Let us understand
event-driven architecture.

2
00:00:03.220 --> 00:00:06.200
A school posts that sports
day has been confirmed.

3
00:00:07.160 --> 00:00:10.460
Teachers arrange transport,
the canteen plans food and

4
00:00:10.460 --> 00:00:14.100
students bring equipment. The
announcement is one fact with

5
00:00:14.100 --> 00:00:17.320
several independent reactions.
If the date is corrected,

6
00:00:17.820 --> 00:00:21.040
people need a clear update
rather than silently rewriting an

7
00:00:21.040 --> 00:00:23.140
announcement they already acted on.

8
00:00:23.640 --> 00:00:27.180
In event-driven architecture,
components announce facts that

9
00:00:27.180 --> 00:00:29.240
happened and other components react.

10
00:00:29.240 --> 00:00:33.120
An event such as BookingConfirmed
differs from a command

11
00:00:33.120 --> 00:00:36.820
such as ConfirmBooking, which
asks an owner to perform an

12
00:00:36.820 --> 00:00:40.860
action. Follow the normal
path. The booking owner

13
00:00:40.860 --> 00:00:44.300
establishes that the booking
is confirmed, then reliably

14
00:00:44.300 --> 00:00:48.740
publishes the associated fact.
Publication and storage must

15
00:00:48.740 --> 00:00:52.420
have an explicit failure
strategy. The event channel makes

16
00:00:52.420 --> 00:00:54.700
the fact available to
separate subscribers.

17
00:00:54.700 --> 00:00:58.700
Each subscriber has a distinct
business responsibility and

18
00:00:58.700 --> 00:01:03.000
its own processing state.
SeatSpot booking confirmation can

19
00:01:03.000 --> 00:01:06.900
trigger receipts, analytics
and loyalty updates without the

20
00:01:06.900 --> 00:01:09.600
booking service synchronously
calling every consumer.

21
00:01:10.460 --> 00:01:14.260
This reduces direct coupling
but introduces asynchronous

22
00:01:14.260 --> 00:01:17.680
coordination. Now change one condition.

23
00:01:18.640 --> 00:01:21.700
Analytics becomes slow while
receipt processing continues.

24
00:01:21.700 --> 00:01:25.800
Subscriber delay is observable;
it should not silently

25
00:01:25.800 --> 00:01:28.080
redefine the original booking outcome.

26
00:01:28.620 --> 00:01:31.960
A common misunderstanding
is this: Publishing an event

27
00:01:31.960 --> 00:01:35.020
creates one atomic transaction
across subscribers.

28
00:01:36.060 --> 00:01:39.220
Independent consumers have
separate state, delay and failure

29
00:01:39.220 --> 00:01:43.340
boundaries. Think about this.
BookingConfirmed is replayed.

30
00:01:43.820 --> 00:01:46.840
Should every subscriber repeat
its old external action?

31
00:01:46.840 --> 00:01:49.080
Pause the video and make your prediction.

32
00:01:49.780 --> 00:01:53.440
No. Rebuilding analytics and
resending old receipts have

33
00:01:53.440 --> 00:01:56.920
different consequences. Each
consumer needs an explicit

34
00:01:56.920 --> 00:02:01.160
replay policy. Let us reason
with a concrete example.

35
00:02:01.160 --> 00:02:04.960
BookingConfirmed has receipt,
analytics and loyalty

36
00:02:04.960 --> 00:02:08.700
subscribers. A failed analytics
consumer should not roll

37
00:02:08.700 --> 00:02:12.360
back a valid booking.
Loyalty may remain eventually

38
00:02:12.360 --> 00:02:15.640
consistent, while seat ownership
must stay authoritative.

39
00:02:15.640 --> 00:02:20.580
Document each subscriber
obligation and recovery/replay

40
00:02:20.580 --> 00:02:24.300
rules. Replaying an analytics
event is different from

41
00:02:24.300 --> 00:02:26.520
sending every historical receipt again.

42
00:02:27.080 --> 00:02:30.140
These figures are teaching
examples, not production

43
00:02:30.140 --> 00:02:33.800
guarantees. Turn the idea
into a design decision.

44
00:02:34.340 --> 00:02:37.800
A repeated delivery uses the
same logical event identity.

45
00:02:38.640 --> 00:02:41.340
Consumers must avoid awarding
points or producing another

46
00:02:41.340 --> 00:02:44.800
external effect accidentally.
Add compatible fields

47
00:02:44.800 --> 00:02:48.220
carefully and test old
consumers. Retained events and

48
00:02:48.220 --> 00:02:50.840
delayed subscribers may
outlive the latest deployment.

49
00:02:51.400 --> 00:02:54.180
When you try the practice
task, look for this result.

50
00:02:54.700 --> 00:02:58.560
A repeated event must not award
loyalty points twice; replay

51
00:02:58.560 --> 00:03:01.880
is a business decision.
Check your understanding.

52
00:03:02.820 --> 00:03:05.380
Replay analytics when
appropriate, but do not resend

53
00:03:05.380 --> 00:03:09.160
historical receipts
automatically. Reprocessing policy

54
00:03:09.160 --> 00:03:11.960
depends on the side effects
owned by each subscriber.

55
00:03:11.960 --> 00:03:15.760
Here is a challenge. A
loyalty consumer receives

56
00:03:15.760 --> 00:03:19.100
BookingConfirmed twice.
What must remain true?

57
00:03:19.320 --> 00:03:22.360
Pause before the answer.
The booking should earn the

58
00:03:22.360 --> 00:03:25.660
intended points once.
Deduplicate or make the update

59
00:03:25.660 --> 00:03:29.240
idempotent within a durable
transaction; account for partial

60
00:03:29.240 --> 00:03:33.040
failure around external effects.
For an interview, discuss

61
00:03:33.040 --> 00:03:36.220
versioned contracts, lag
and idempotent consumers.

62
00:03:36.980 --> 00:03:39.660
Say what you would measure,
not only which tool you would

63
00:03:39.660 --> 00:03:39.980
buy.
