WEBVTT

1
00:00:00.000 --> 00:00:03.940
Let us understand microservices.
A school has a library

2
00:00:03.940 --> 00:00:06.940
team, accounts team and transport team.

3
00:00:07.260 --> 00:00:10.020
Each owns a different
responsibility and communicates

4
00:00:10.020 --> 00:00:14.060
through clear requests. If
every tiny task needs a meeting

5
00:00:14.060 --> 00:00:16.380
with every team, work becomes slower.

6
00:00:16.920 --> 00:00:19.980
More teams are helpful only
when their boundaries reduce

7
00:00:19.980 --> 00:00:22.660
coordination rather than create it.

8
00:00:23.360 --> 00:00:26.860
Microservices split a system
into independently deployable

9
00:00:26.860 --> 00:00:30.800
business services. The useful
boundary is ownership of a

10
00:00:30.800 --> 00:00:34.860
capability and its data, not
an arbitrary number of small

11
00:00:34.860 --> 00:00:38.580
functions or servers.
Follow the normal path.

12
00:00:39.000 --> 00:00:42.140
Name business responsibilities
before drawing services.

13
00:00:42.980 --> 00:00:46.060
Catalog descriptions and
authoritative seat reservations

14
00:00:46.060 --> 00:00:49.200
have different ownership and
correctness requirements.

15
00:00:49.920 --> 00:00:53.260
Each capability owns its
protected state and exposes

16
00:00:53.260 --> 00:00:57.160
contracts. Giving every service
write access to every table

17
00:00:57.160 --> 00:00:59.520
defeats much of the intended independence.

18
00:00:59.520 --> 00:01:03.920
SeatSpot may separate booking,
catalog and notifications

19
00:01:03.920 --> 00:01:08.920
when team ownership, scaling
or deployment needs justify it.

20
00:01:09.300 --> 00:01:12.780
A small team can often start
with a modular monolith and

21
00:01:12.780 --> 00:01:15.380
preserve those boundaries
without network overhead.

22
00:01:16.360 --> 00:01:20.020
Now change one condition.
The booking workflow contacts

23
00:01:20.020 --> 00:01:23.880
payments. That call can time
out or succeed remotely while

24
00:01:23.880 --> 00:01:27.100
its response is lost; it
is not a local transaction.

25
00:01:27.920 --> 00:01:31.200
A common misunderstanding is
this: Every function should

26
00:01:31.200 --> 00:01:35.120
become a microservice.
Fine-grained network boundaries can

27
00:01:35.120 --> 00:01:38.900
add latency, coordination
and partial failures without

28
00:01:38.900 --> 00:01:42.980
useful autonomy. Think about
this. Catalog, booking and

29
00:01:42.980 --> 00:01:45.600
payment must deploy
together after every change.

30
00:01:46.100 --> 00:01:47.760
Are they operationally independent?

31
00:01:48.360 --> 00:01:50.300
Pause the video and make your prediction.

32
00:01:50.880 --> 00:01:54.680
Probably not yet. Inspect
shared schemas and contracts

33
00:01:54.680 --> 00:01:58.020
before calling separate
processes independent services.

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

35
00:02:01.720 --> 00:02:05.300
A confirmation requires catalog
lookup, seat reservation,

36
00:02:05.860 --> 00:02:09.960
payment and notification. Putting
all four behind sequential

37
00:02:09.960 --> 00:02:13.940
network calls increases latency
and failure combinations.

38
00:02:14.660 --> 00:02:18.880
Notification can be asynchronous;
reservation/payment need

39
00:02:18.880 --> 00:02:21.380
an explicit state machine
and reconciliation.

40
00:02:22.260 --> 00:02:24.840
Start with the required
invariant and workflow.

41
00:02:25.540 --> 00:02:28.420
Separate a capability only
when the autonomy benefit

42
00:02:28.420 --> 00:02:31.180
outweighs the distributed
coordination cost.

43
00:02:31.800 --> 00:02:34.720
These figures are teaching
examples, not production

44
00:02:34.720 --> 00:02:38.620
guarantees. Turn the idea
into a design decision.

45
00:02:39.220 --> 00:02:42.720
Confirmation can publish
notification work after reliable

46
00:02:42.720 --> 00:02:47.260
business-state coordination.
A slow email provider need not

47
00:02:47.260 --> 00:02:49.540
occupy the booking request indefinitely.

48
00:02:50.600 --> 00:02:54.260
Old and new callers may coexist.
Test contract compatibility

49
00:02:54.260 --> 00:02:58.040
and observe version-specific
errors instead of requiring

50
00:02:58.040 --> 00:03:00.280
every service to deploy in lockstep.

51
00:03:00.900 --> 00:03:03.960
When you try the practice
task, look for this result.

52
00:03:04.680 --> 00:03:08.140
Separate deployment earns its
complexity only when ownership

53
00:03:08.140 --> 00:03:11.700
and autonomy are useful.
Check your understanding.

54
00:03:11.700 --> 00:03:16.040
For a small team, a modular
monolith may satisfy the same

55
00:03:16.040 --> 00:03:18.460
domain boundaries with fewer moving parts.

56
00:03:19.180 --> 00:03:21.600
Choose services from
requirements rather than fashion.

57
00:03:22.120 --> 00:03:25.820
Here is a challenge. A two-person
team has low traffic and

58
00:03:25.820 --> 00:03:29.520
no independent deployment needs.
Must it use microservices?

59
00:03:30.020 --> 00:03:34.000
Pause before the answer. No.
A modular monolith can keep

60
00:03:34.000 --> 00:03:37.200
clear domains with simpler
transactions and operations.

61
00:03:37.200 --> 00:03:41.260
Revisit extraction when
measured scaling, ownership or

62
00:03:41.260 --> 00:03:44.840
release constraints justify
it. For an interview, discuss

63
00:03:44.840 --> 00:03:48.140
contracts, state machines and
asynchronous notification.

64
00:03:48.960 --> 00:03:51.460
Say what you would measure,
not only which tool you would

65
00:03:51.460 --> 00:03:51.740
buy.
