-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem-design.html
More file actions
2189 lines (2058 loc) · 144 KB
/
Copy pathsystem-design.html
File metadata and controls
2189 lines (2058 loc) · 144 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>System Design Academy — Interactive Index</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=IBM+Plex+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<link rel="stylesheet" href="styles/academy.css" />
<style>
/* index-specific overrides */
body { background-image:
linear-gradient(var(--rule) 1px, transparent 1px),
linear-gradient(90deg, var(--rule) 1px, transparent 1px);
background-size: 56px 56px; background-position: -1px -1px; background-attachment: fixed; }
body::before { content:""; position: fixed; inset:0; background: var(--paper); opacity:.94; pointer-events:none; z-index:0; }
.wrap { z-index: 1; }
.hero { padding: 64px 0 36px; }
/* ── Featured deep dives ─────────────────────────────────────────────── */
.featured-section {
margin: 28px 0 52px;
}
.feat-head {
display: flex; justify-content: space-between; align-items: baseline;
border-top: 1px solid var(--ink);
padding: 24px 0 22px;
margin-bottom: 0;
}
.feat-head h2 {
font-family: 'Instrument Serif', serif; font-weight: 400;
font-size: clamp(34px, 4vw, 48px); margin: 0;
letter-spacing: -0.015em; line-height: 1;
}
.feat-head h2 .ital { font-style: italic; color: var(--accent); }
.feat-head .meta {
font-family: 'JetBrains Mono', monospace; font-size: 11px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute);
}
.feat-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 0;
border: 1px solid var(--ink);
border-top: none;
}
.feat-card {
border-right: 1px solid var(--ink);
border-bottom: 1px solid var(--ink);
padding: 26px 26px 24px;
text-decoration: none; color: inherit;
background: var(--paper);
display: flex; flex-direction: column;
min-height: 320px;
position: relative;
transition: background 0.15s;
}
.feat-card:nth-child(4n) { border-right: none; }
.feat-card:nth-last-child(-n+4) { border-bottom: none; }
@media (max-width: 1200px) {
.feat-grid { grid-template-columns: repeat(3, 1fr); }
.feat-card { border-right: 1px solid var(--ink) !important; border-bottom: 1px solid var(--ink) !important; }
.feat-card:nth-child(3n) { border-right: none !important; }
.feat-card:nth-last-child(-n+2) { border-bottom: none !important; }
}
.feat-card:hover { background: var(--highlight); }
.feat-card .feat-num {
font-family: 'JetBrains Mono', monospace; font-size: 10px;
color: var(--accent); letter-spacing: 0.16em; text-transform: uppercase;
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 22px;
}
.feat-card .feat-num .badge {
background: var(--accent); color: var(--paper);
padding: 3px 7px; font-size: 9px; letter-spacing: 0.14em;
}
.feat-card .feat-svg {
margin: 0 0 20px;
height: 90px;
display: flex; align-items: center;
}
.feat-card .feat-svg svg { width: 100%; height: 100%; display: block; }
.feat-card h3 {
font-family: 'Instrument Serif', serif; font-weight: 400;
font-size: 32px; line-height: 1.05; margin: 0 0 12px;
letter-spacing: -0.01em;
}
.feat-card:hover h3 { color: var(--accent-deep); }
.feat-card p {
font-size: 14px; line-height: 1.5; color: var(--ink-soft);
margin: 0 0 20px;
}
.feat-card .feat-foot {
margin-top: auto;
display: flex; justify-content: space-between; align-items: center;
padding-top: 14px; border-top: 1px dashed var(--rule);
font-family: 'JetBrains Mono', monospace; font-size: 10px;
text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-mute);
}
.feat-card .feat-foot .arrow { font-size: 16px; color: var(--accent); transition: transform 0.2s; }
.feat-card:hover .feat-foot .arrow { transform: translate(4px, -4px); }
@media (max-width: 900px) {
.feat-grid { grid-template-columns: repeat(2, 1fr); }
.feat-card { border-right: 1px solid var(--ink) !important; }
.feat-card:nth-child(2n) { border-right: none !important; }
.feat-card:nth-last-child(-n+3) { border-bottom: 1px solid var(--ink); }
.feat-card:nth-last-child(-n+2) { border-bottom: none; }
}
@media (max-width: 620px) {
.feat-grid { grid-template-columns: 1fr; }
.feat-card { border-right: none !important; border-bottom: 1px solid var(--ink) !important; min-height: 240px; }
.feat-card:last-child { border-bottom: none !important; }
}
/* ── Controls ────────────────────────────────────────────────────────── */
.controls { display: flex; flex-direction: column; gap: 18px; margin-bottom: 32px; }
.search-row { display: flex; gap: 12px; align-items: stretch; }
.search { flex: 1; position: relative; border: 1px solid var(--ink); background: var(--paper); }
.search input {
width: 100%; border: 0; background: transparent;
padding: 18px 20px 18px 52px;
font-family: 'Instrument Serif', serif; font-size: 22px;
color: var(--ink); outline: none;
}
.search input::placeholder { color: var(--ink-mute); font-style: italic; }
.search .ico { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); }
.random-btn {
border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
padding: 0 22px; cursor: pointer; font-family: 'JetBrains Mono', monospace;
font-size: 11px; text-transform: uppercase; letter-spacing: 0.18em;
transition: all 0.15s; white-space: nowrap;
}
.random-btn:hover { background: var(--accent); border-color: var(--accent); }
.random-btn .arrow { display: inline-block; transition: transform 0.4s; margin-left: 6px; }
.random-btn:hover .arrow { transform: rotate(360deg); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat {
font-family: 'JetBrains Mono', monospace; font-size: 11px;
text-transform: uppercase; letter-spacing: 0.12em;
padding: 9px 14px; border: 1px solid var(--rule);
background: transparent; color: var(--ink-soft); cursor: pointer;
transition: all 0.15s;
}
.cat:hover { border-color: var(--ink); color: var(--ink); }
.cat.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat .count { opacity: 0.6; margin-left: 6px; font-size: 10px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letter {
font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 500;
width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
border: 1px solid transparent; background: transparent; color: var(--ink-soft);
cursor: pointer; transition: all 0.15s;
}
.letter:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.letter.active { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.letter:disabled { color: var(--rule); cursor: not-allowed; }
.letter.all { width: auto; padding: 0 12px; }
.resultbar {
display: flex; justify-content: space-between; align-items: baseline;
margin: 14px 0 20px; padding-top: 18px; border-top: 1px solid var(--rule);
font-family: 'JetBrains Mono', monospace; font-size: 11px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute);
}
.resultbar .count-big {
font-family: 'Instrument Serif', serif; font-size: 32px;
color: var(--ink); text-transform: none; letter-spacing: -0.01em;
}
.resultbar button.clear {
background: none; border: none; cursor: pointer; color: var(--accent);
font-family: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit;
text-decoration: underline; text-underline-offset: 4px;
}
.resultbar button.clear:hover { color: var(--accent-deep); }
.grid {
display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 0;
border-top: 1px solid var(--ink);
border-left: 1px solid var(--ink);
}
.card {
border-right: 1px solid var(--ink);
border-bottom: 1px solid var(--ink);
padding: 22px 22px 20px;
background: var(--paper);
text-decoration: none; color: inherit;
display: flex; flex-direction: column; gap: 12px;
min-height: 180px;
position: relative;
transition: background 0.15s;
}
.card:hover { background: var(--highlight); }
.card:hover .card-title { color: var(--accent-deep); }
.card:hover .arr { transform: translate(4px, -4px); color: var(--accent); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tag {
font-family: 'JetBrains Mono', monospace; font-size: 10px;
text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-mute);
}
.tag .dot { color: var(--accent); margin: 0 6px; }
.tag .deep-badge {
background: var(--accent); color: var(--paper);
padding: 2px 6px; margin-left: 8px;
font-size: 9px; letter-spacing: 0.14em;
}
.arr { font-family: 'JetBrains Mono', monospace; font-size: 18px; color: var(--ink-soft); transition: all 0.2s; line-height: 1; }
.card-title {
font-family: 'Instrument Serif', serif;
font-size: 24px; line-height: 1.15; font-weight: 400;
color: var(--ink); margin: 0;
transition: color 0.15s;
}
.card-foot {
margin-top: auto; padding-top: 12px;
font-family: 'JetBrains Mono', monospace; font-size: 10px;
color: var(--ink-mute); text-transform: lowercase; letter-spacing: 0.04em;
border-top: 1px dashed var(--rule);
display: flex; justify-content: space-between; align-items: center;
}
.card-foot .num { font-variant-numeric: tabular-nums; opacity: 0.6; }
.empty { text-align: center; padding: 80px 20px; border: 1px dashed var(--rule); background: rgba(255,255,255,0.4); }
.empty h3 { font-family: 'Instrument Serif', serif; font-size: 40px; font-style: italic; color: var(--ink-mute); margin: 0 0 8px; font-weight: 400; }
.empty p { color: var(--ink-mute); font-size: 14px; margin: 0; }
@media (max-width: 560px) {
.wrap { padding: 0 18px 60px; }
.hero { padding: 40px 0 24px; }
.card { padding: 18px; min-height: 150px; }
.card-title { font-size: 20px; }
.search input { font-size: 18px; padding: 14px 16px 14px 44px; }
.search .ico { left: 14px; }
.random-btn { padding: 0 14px; }
}
</style>
</head>
<body>
<div class="wrap">
<header class="topbar">
<div class="brand">
<span class="brand-mark"></span>
<span>System Design Academy</span>
</div>
<nav>
<a href="#featured">Deep Dives</a>
<a href="#index">Index</a>
<a href="https://github.com/systemdesign42/system-design-academy" target="_blank" rel="noopener">↗ source</a>
</nav>
</header>
<section class="hero">
<div class="eyebrow">a curated technical index · edition 2026</div>
<h1 class="hero-h1">How the <span class="ital">internet</span><br/>actually works.</h1>
<p class="lede">One hundred and fifty case studies and primers from the engineers who built it, with <em>six deep dives</em> covering the patterns you will be asked about in any senior interview — diagrams, production-grade .NET, and the tradeoffs nobody puts in the brochure.</p>
</section>
<div class="stats" id="stats"></div>
<!-- ── FEATURED DEEP DIVES ─────────────────────────────────────────── -->
<section class="featured-section" id="featured">
<div class="feat-head">
<h2>Featured <span class="ital">deep dives</span></h2>
<span class="meta">22 deep dives · 18 case studies · 34 fundamentals · 12 interviews · 8 AI · 3 white papers · 2026</span>
</div>
<div class="feat-grid">
<a class="feat-card" href="topics/rate-limiting.html">
<div class="feat-num"><span>Chapter 01</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="22" height="50" fill="#1a1814"/>
<rect x="34" y="34" width="22" height="36" fill="#c2410c"/>
<rect x="62" y="14" width="22" height="56" fill="#1a1814"/>
<rect x="90" y="44" width="22" height="26" fill="#c2410c"/>
<rect x="118" y="24" width="22" height="46" fill="#1a1814"/>
<rect x="146" y="54" width="22" height="16" fill="#c2410c"/>
<rect x="174" y="38" width="22" height="32" fill="#1a1814"/>
<line x1="0" y1="14" x2="200" y2="14" stroke="#c2410c" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="200" y="11" text-anchor="end" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.1em">LIMIT</text>
</svg>
</div>
<h3>Rate limiting</h3>
<p>Token bucket, sliding window, distributed Redis Lua scripts. How Stripe shapes 1B+ daily requests without melting downstream services.</p>
<div class="feat-foot"><span>4 algorithms · 6 vendors</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/caching-patterns.html">
<div class="feat-num"><span>Chapter 02</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="50" height="50" fill="#1a1814"/>
<rect x="60" y="34" width="50" height="36" fill="#c2410c"/>
<rect x="114" y="20" width="50" height="50" fill="#1a1814"/>
<text x="31" y="55" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1" letter-spacing="0.1em">APP</text>
<text x="85" y="58" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#1a1814" letter-spacing="0.1em">CACHE</text>
<text x="139" y="55" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1" letter-spacing="0.1em">DB</text>
<path d="M168 45 L182 45" stroke="#c2410c" stroke-width="2"/>
<polyline points="178,41 182,45 178,49" fill="none" stroke="#c2410c" stroke-width="2"/>
</svg>
</div>
<h3>Caching patterns</h3>
<p>Cache-aside, write-through, write-behind. Two-tier L1/L2 with IMemoryCache + Redis. Why 99% of cache bugs are invalidation bugs.</p>
<div class="feat-foot"><span>5 patterns · L1/L2 stack</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/message-queues.html">
<div class="feat-num"><span>Chapter 03</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="30" height="22" fill="#c2410c"/>
<rect x="42" y="20" width="116" height="50" fill="#1a1814"/>
<rect x="164" y="34" width="30" height="22" fill="#c2410c"/>
<g fill="#c2410c">
<rect x="50" y="38" width="14" height="14"/>
<rect x="68" y="38" width="14" height="14"/>
<rect x="86" y="38" width="14" height="14"/>
<rect x="104" y="38" width="14" height="14" opacity="0.5"/>
<rect x="122" y="38" width="14" height="14" opacity="0.3"/>
<rect x="140" y="38" width="14" height="14" opacity="0.2"/>
</g>
</svg>
</div>
<h3>Message queues</h3>
<p>Kafka vs RabbitMQ vs Azure Service Bus vs SQS. Producer reliability, consumer idempotency, the transactional outbox done right in EF Core.</p>
<div class="feat-foot"><span>4 brokers · outbox</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/consistency-patterns.html">
<div class="feat-num"><span>Chapter 04</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<polygon points="100,8 192,68 8,68" fill="none" stroke="#1a1814" stroke-width="2"/>
<text x="100" y="6" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#1a1814" letter-spacing="0.14em">C</text>
<text x="6" y="80" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#1a1814" letter-spacing="0.14em">A</text>
<text x="194" y="80" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#1a1814" letter-spacing="0.14em">P</text>
<circle cx="100" cy="48" r="10" fill="#c2410c"/>
<text x="100" y="51" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">PICK 2</text>
</svg>
</div>
<h3>Consistency patterns</h3>
<p>CAP isn't enough. Strong, eventual, read-your-writes, monotonic, bounded staleness — mapped to Cosmos DB levels & EF Core isolation.</p>
<div class="feat-foot"><span>5 levels · Cosmos DB</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/api-gateway.html">
<div class="feat-num"><span>Chapter 05</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="28" height="22" fill="#1a1814"/>
<rect x="48" y="34" width="28" height="22" fill="#c2410c"/>
<line x1="34" y1="45" x2="48" y2="45" stroke="#1a1814" stroke-width="2"/>
<rect x="90" y="6" width="40" height="22" fill="#1a1814"/>
<rect x="90" y="34" width="40" height="22" fill="#1a1814"/>
<rect x="90" y="62" width="40" height="22" fill="#1a1814"/>
<line x1="76" y1="45" x2="90" y2="17" stroke="#c2410c" stroke-width="1.5"/>
<line x1="76" y1="45" x2="90" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<line x1="76" y1="45" x2="90" y2="73" stroke="#c2410c" stroke-width="1.5"/>
<text x="62" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">GW</text>
</svg>
</div>
<h3>API gateway, LB & proxy</h3>
<p>What each layer actually does. YARP-based gateway with auth, rate limit, routing. When you need three; when you need one.</p>
<div class="feat-foot"><span>3 layers · YARP</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/consistent-hashing.html">
<div class="feat-num"><span>Chapter 06</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<circle cx="100" cy="45" r="36" fill="none" stroke="#1a1814" stroke-width="2"/>
<circle cx="100" cy="9" r="5" fill="#c2410c"/>
<circle cx="131" cy="27" r="5" fill="#c2410c"/>
<circle cx="131" cy="63" r="5" fill="#c2410c"/>
<circle cx="100" cy="81" r="5" fill="#c2410c"/>
<circle cx="69" cy="63" r="5" fill="#c2410c"/>
<circle cx="69" cy="27" r="5" fill="#c2410c"/>
<circle cx="118" cy="18" r="3" fill="#1a1814"/>
<circle cx="138" cy="45" r="3" fill="#1a1814"/>
<circle cx="118" cy="72" r="3" fill="#1a1814"/>
<circle cx="82" cy="72" r="3" fill="#1a1814"/>
<circle cx="62" cy="45" r="3" fill="#1a1814"/>
<circle cx="82" cy="18" r="3" fill="#1a1814"/>
</svg>
</div>
<h3>Consistent hashing</h3>
<p>The ring, virtual nodes, and why your shard rebalance shouldn't be a Friday-night incident. Built from scratch in C# for shard routing.</p>
<div class="feat-foot"><span>ring + vnodes</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/database-sharding.html">
<div class="feat-num"><span>Chapter 07</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="8" width="188" height="22" fill="#1a1814"/>
<text x="100" y="23" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1" letter-spacing="0.14em">ID 0..100M</text>
<rect x="6" y="50" width="44" height="32" fill="#c2410c"/>
<rect x="54" y="50" width="44" height="32" fill="#c2410c"/>
<rect x="102" y="50" width="44" height="32" fill="#c2410c"/>
<rect x="150" y="50" width="44" height="32" fill="#c2410c"/>
<line x1="28" y1="30" x2="28" y2="48" stroke="#c2410c" stroke-width="1.5"/>
<line x1="76" y1="30" x2="76" y2="48" stroke="#c2410c" stroke-width="1.5"/>
<line x1="124" y1="30" x2="124" y2="48" stroke="#c2410c" stroke-width="1.5"/>
<line x1="172" y1="30" x2="172" y2="48" stroke="#c2410c" stroke-width="1.5"/>
<text x="100" y="40" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.12em">SHARD KEY</text>
</svg>
</div>
<h3>Database sharding</h3>
<p>Range vs hash vs directory. EF Core multi-context router with virtual nodes, online resharding without downtime, and the cost ledger.</p>
<div class="feat-foot"><span>3 schemes · 6 vendors</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/idempotency-keys.html">
<div class="feat-num"><span>Chapter 08</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="32" width="40" height="26" fill="#1a1814"/>
<text x="26" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">REQ</text>
<rect x="62" y="20" width="50" height="50" fill="#c2410c"/>
<text x="87" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">SETNX</text>
<text x="87" y="54" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">KEY</text>
<rect x="128" y="6" width="62" height="34" fill="#1a1814"/>
<text x="159" y="26" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">EXECUTE</text>
<rect x="128" y="50" width="62" height="34" fill="#c2410c"/>
<text x="159" y="70" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">REPLAY</text>
<line x1="46" y1="45" x2="60" y2="45" stroke="#c2410c" stroke-width="2"/>
<line x1="112" y1="30" x2="126" y2="23" stroke="#1a1814" stroke-width="1.5"/>
<line x1="112" y1="60" x2="126" y2="67" stroke="#c2410c" stroke-width="1.5"/>
</svg>
</div>
<h3>Idempotency keys</h3>
<p>Stripe-style header, Redis SETNX lock, response cache, and the EF Core unique index belt-and-braces that survives a Redis outage.</p>
<div class="feat-foot"><span>3 paths · 6 stores</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/saga-pattern.html">
<div class="feat-num"><span>Chapter 09</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="34" height="22" fill="#1a1814"/>
<rect x="56" y="34" width="34" height="22" fill="#1a1814"/>
<rect x="106" y="34" width="34" height="22" fill="#1a1814"/>
<rect x="156" y="34" width="34" height="22" fill="#c2410c"/>
<line x1="40" y1="45" x2="56" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<line x1="90" y1="45" x2="106" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<line x1="140" y1="45" x2="156" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<path d="M173 56 C 173 74, 23 74, 23 56" fill="none" stroke="#c2410c" stroke-width="1.5" stroke-dasharray="3 2"/>
<polyline points="27,52 23,56 27,60" fill="none" stroke="#c2410c" stroke-width="1.5"/>
<text x="100" y="14" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.12em">FORWARD →</text>
<text x="100" y="86" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.12em">← COMPENSATE</text>
</svg>
</div>
<h3>Saga pattern</h3>
<p>Orchestration vs choreography, compensating actions, and the MassTransit state machine that survives every crash mid-checkout.</p>
<div class="feat-foot"><span>6 engines · MassTransit</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/realtime-channels.html">
<div class="feat-num"><span>Chapter 10</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="38" height="22" fill="#1a1814"/>
<text x="25" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">CLI</text>
<rect x="156" y="34" width="38" height="22" fill="#1a1814"/>
<text x="175" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">SRV</text>
<rect x="60" y="14" width="80" height="14" fill="#c2410c"/>
<text x="100" y="24" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">CLIENT→SERVER</text>
<rect x="60" y="62" width="80" height="14" fill="#c2410c"/>
<text x="100" y="72" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">SERVER→CLIENT</text>
<line x1="44" y1="40" x2="60" y2="20" stroke="#c2410c" stroke-width="1.5"/>
<line x1="140" y1="20" x2="156" y2="40" stroke="#c2410c" stroke-width="1.5"/>
<line x1="44" y1="50" x2="60" y2="69" stroke="#c2410c" stroke-width="1.5"/>
<line x1="140" y1="69" x2="156" y2="50" stroke="#c2410c" stroke-width="1.5"/>
</svg>
</div>
<h3>WebSockets, SSE & long polling</h3>
<p>SignalR with a Redis backplane, when SSE wins, when long-polling is still the right answer — and what 100k concurrent connections costs you.</p>
<div class="feat-foot"><span>3 transports · 7 vendors</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/resilience-polly.html">
<div class="feat-num"><span>Chapter 11</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<circle cx="100" cy="45" r="32" fill="none" stroke="#1a1814" stroke-width="3"/>
<path d="M68 45 a32 32 0 0 1 64 0" fill="none" stroke="#c2410c" stroke-width="3"/>
<line x1="100" y1="13" x2="100" y2="45" stroke="#1a1814" stroke-width="2"/>
<line x1="100" y1="45" x2="122" y2="45" stroke="#c2410c" stroke-width="2"/>
<text x="100" y="83" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">OPEN · HALF · CLOSED</text>
</svg>
</div>
<h3>Resilience & circuit breakers</h3>
<p>Polly v8 pipelines — timeout, retry with jitter, bulkhead, breaker — composed once and applied everywhere through HttpClientFactory.</p>
<div class="feat-foot"><span>4 strategies · Polly v8</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/monolith-vs-microservices.html">
<div class="feat-num"><span>Chapter 12</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="56" height="50" fill="#1a1814"/>
<text x="34" y="50" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">MONO</text>
<rect x="74" y="20" width="56" height="50" fill="#c2410c" stroke="#f1ece1" stroke-width="1" stroke-dasharray="2 2"/>
<text x="102" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">module</text>
<text x="102" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">module</text>
<g>
<rect x="142" y="14" width="22" height="22" fill="#1a1814"/>
<rect x="168" y="14" width="22" height="22" fill="#1a1814"/>
<rect x="142" y="40" width="22" height="22" fill="#1a1814"/>
<rect x="168" y="40" width="22" height="22" fill="#1a1814"/>
</g>
<text x="100" y="86" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">MONO · MODULAR · MICRO</text>
</svg>
</div>
<h3>Monolith vs microservices</h3>
<p>Shopify's 30 TB/min on a modular monolith. The cost ledger of the split. When you actually need to extract — and the strangler pattern that doesn't break things.</p>
<div class="feat-foot"><span>3 shapes · cost ledger</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/event-sourcing-cqrs.html">
<div class="feat-num"><span>Chapter 13</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="30" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="54" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="78" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="102" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="126" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="150" y="40" width="22" height="14" fill="#c2410c"/>
<rect x="174" y="40" width="20" height="14" fill="#c2410c"/>
<text x="100" y="32" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">EVENT STREAM →</text>
<rect x="20" y="70" width="50" height="16" fill="#1a1814"/>
<text x="45" y="82" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">summary</text>
<rect x="76" y="70" width="50" height="16" fill="#1a1814"/>
<text x="101" y="82" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">index</text>
<rect x="132" y="70" width="50" height="16" fill="#1a1814"/>
<text x="157" y="82" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">report</text>
<line x1="45" y1="56" x2="45" y2="68" stroke="#c2410c" stroke-width="1"/>
<line x1="101" y1="56" x2="101" y2="68" stroke="#c2410c" stroke-width="1"/>
<line x1="157" y1="56" x2="157" y2="68" stroke="#c2410c" stroke-width="1"/>
</svg>
</div>
<h3>Event sourcing & CQRS</h3>
<p>Marten on Postgres, EventStoreDB, projections rebuilt from event zero. Snapshot once, project forever. The audit log is the database.</p>
<div class="feat-foot"><span>6 stores · Marten</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/bloom-filters.html">
<div class="feat-num"><span>Chapter 14</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<g>
<rect x="6" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
<rect x="24" y="30" width="16" height="30" fill="#c2410c" stroke="#1a1814"/>
<rect x="42" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
<rect x="60" y="30" width="16" height="30" fill="#c2410c" stroke="#1a1814"/>
<rect x="78" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
<rect x="96" y="30" width="16" height="30" fill="#c2410c" stroke="#1a1814"/>
<rect x="114" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
<rect x="132" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
<rect x="150" y="30" width="16" height="30" fill="#c2410c" stroke="#1a1814"/>
<rect x="168" y="30" width="16" height="30" fill="#f1ece1" stroke="#1a1814"/>
</g>
<text x="100" y="22" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">10 BITS / ITEM · 1% FP · 0% FN</text>
</svg>
</div>
<h3>Bloom filters</h3>
<p>10 bits per item, 1% false positives, zero false negatives. From scratch in C# with the Kirsch–Mitzenmacher trick. Plus RedisBloom for multi-pod.</p>
<div class="feat-foot"><span>6 stores · BF.* commands</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/service-discovery.html">
<div class="feat-num"><span>Chapter 15</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="42" height="22" fill="#1a1814"/>
<text x="27" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">CLI</text>
<rect x="70" y="20" width="60" height="50" fill="#c2410c"/>
<text x="100" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">DNS /</text>
<text x="100" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">REG</text>
<rect x="152" y="14" width="42" height="22" fill="#1a1814"/>
<text x="173" y="29" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">pod</text>
<rect x="152" y="40" width="42" height="22" fill="#1a1814"/>
<text x="173" y="55" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">pod</text>
<rect x="152" y="66" width="42" height="22" fill="#1a1814"/>
<text x="173" y="81" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">pod</text>
<line x1="48" y1="45" x2="68" y2="45" stroke="#c2410c" stroke-width="2"/>
<line x1="130" y1="40" x2="150" y2="25" stroke="#c2410c" stroke-width="1.5"/>
<line x1="130" y1="45" x2="150" y2="51" stroke="#c2410c" stroke-width="1.5"/>
<line x1="130" y1="50" x2="150" y2="77" stroke="#c2410c" stroke-width="1.5"/>
</svg>
</div>
<h3>Service discovery</h3>
<p>DNS vs registry. K8s ClusterIP, Consul, Service Fabric. The PooledConnectionLifetime line that prevents your <code>HttpClient</code> from dialling a dead pod.</p>
<div class="feat-foot"><span>6 systems · K8s DNS</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/leader-election.html">
<div class="feat-num"><span>Chapter 16</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<circle cx="40" cy="45" r="18" fill="#1a1814"/>
<text x="40" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">F</text>
<circle cx="100" cy="45" r="18" fill="#c2410c"/>
<text x="100" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">LEAD</text>
<circle cx="160" cy="45" r="18" fill="#1a1814"/>
<text x="160" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">F</text>
<line x1="58" y1="45" x2="82" y2="45" stroke="#c2410c" stroke-width="2"/>
<line x1="118" y1="45" x2="142" y2="45" stroke="#c2410c" stroke-width="2"/>
<text x="100" y="20" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">LEASE · FENCE · ELECT</text>
<text x="100" y="82" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">heartbeat</text>
</svg>
</div>
<h3>Leader election</h3>
<p>DistributedLock on whatever store you already run. When Raft (etcd, ZooKeeper) is worth it. Why fencing tokens — not locks — are the actual safety.</p>
<div class="feat-foot"><span>7 stores · fencing</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/change-data-capture.html">
<div class="feat-num"><span>Chapter 17</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="32" width="42" height="26" fill="#1a1814"/>
<text x="27" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">DB</text>
<path d="M48 45 C 75 25, 95 25, 110 45" fill="none" stroke="#c2410c" stroke-width="2"/>
<polyline points="106,41 110,45 106,49" fill="none" stroke="#c2410c" stroke-width="2"/>
<rect x="110" y="32" width="42" height="26" fill="#c2410c"/>
<text x="131" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">CDC</text>
<line x1="152" y1="45" x2="172" y2="45" stroke="#c2410c" stroke-width="2"/>
<rect x="172" y="32" width="22" height="26" fill="#1a1814"/>
<text x="183" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">K</text>
<text x="100" y="22" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">ROW · WAL · TOPIC</text>
</svg>
</div>
<h3>CDC & outbox</h3>
<p>Debezium vs Azure SQL CDC vs the EF Core transactional outbox. When the WAL is the stream — and when the outbox shapes the contract better.</p>
<div class="feat-foot"><span>6 patterns · outbox</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/search-architecture.html">
<div class="feat-num"><span>Chapter 18</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="14" width="60" height="14" fill="#1a1814"/>
<text x="36" y="24" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">doc 1</text>
<rect x="6" y="32" width="60" height="14" fill="#1a1814"/>
<text x="36" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">doc 2</text>
<rect x="6" y="50" width="60" height="14" fill="#1a1814"/>
<text x="36" y="60" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">doc 3</text>
<line x1="68" y1="40" x2="92" y2="40" stroke="#c2410c" stroke-width="2"/>
<polyline points="88,36 92,40 88,44" fill="none" stroke="#c2410c" stroke-width="2"/>
<rect x="96" y="14" width="100" height="60" fill="#c2410c"/>
<text x="146" y="32" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">run → [d1,d3]</text>
<text x="146" y="46" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">shoe → [d1,d2]</text>
<text x="146" y="60" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">red → [d1]</text>
</svg>
</div>
<h3>Search architecture</h3>
<p>Inverted index, BM25, hybrid retrieval. Elasticsearch vs OpenSearch vs Azure AI Search vs Postgres FTS. And the indexing pipeline that keeps it fresh.</p>
<div class="feat-foot"><span>6 engines · hybrid</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/geographic-distribution.html">
<div class="feat-num"><span>Chapter 19</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<circle cx="40" cy="45" r="22" fill="#c2410c"/>
<text x="40" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">US</text>
<circle cx="100" cy="45" r="22" fill="#c2410c"/>
<text x="100" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">EU</text>
<circle cx="160" cy="45" r="22" fill="#c2410c"/>
<text x="160" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">APAC</text>
<path d="M62 38 Q 80 25, 78 38" fill="none" stroke="#1a1814" stroke-width="1.5"/>
<path d="M122 38 Q 140 25, 138 38" fill="none" stroke="#1a1814" stroke-width="1.5"/>
<path d="M62 52 Q 80 65, 78 52" fill="none" stroke="#1a1814" stroke-width="1.5"/>
<path d="M122 52 Q 140 65, 138 52" fill="none" stroke="#1a1814" stroke-width="1.5"/>
<text x="100" y="82" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">ACTIVE / ACTIVE</text>
</svg>
</div>
<h3>Geographic distribution</h3>
<p>Active/passive vs active/active vs partition-by-region. Cosmos multi-master, Spanner, LWW vs CRDT. The question nobody on the architecture review asks: do you actually need it?</p>
<div class="feat-foot"><span>3 shapes · 7 vendors</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/cdn-architecture.html">
<div class="feat-num"><span>Chapter 20</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="170" y="34" width="22" height="22" fill="#1a1814"/>
<text x="181" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">ORIG</text>
<g fill="#c2410c">
<rect x="6" y="34" width="20" height="22"/>
<rect x="32" y="34" width="20" height="22"/>
<rect x="58" y="34" width="20" height="22"/>
<rect x="84" y="34" width="20" height="22"/>
<rect x="110" y="34" width="20" height="22"/>
<rect x="136" y="34" width="20" height="22"/>
</g>
<text x="80" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1" letter-spacing="0.16em">EDGE POPS</text>
<line x1="156" y1="45" x2="168" y2="45" stroke="#1a1814" stroke-width="1.5"/>
<text x="100" y="22" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">99.5% AT THE EDGE</text>
</svg>
</div>
<h3>CDN architecture</h3>
<p>Pull vs push, signed URLs, <code>Cache-Control</code> depth. Why Giphy's edge hit rate is 99.5% and yours is 60%. Hashed filenames, alias swaps, edge functions.</p>
<div class="feat-foot"><span>6 vendors · hit-rate tuning</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/jwt-vs-sessions.html">
<div class="feat-num"><span>Chapter 21</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="84" height="50" fill="#1a1814"/>
<text x="48" y="40" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">SESSION</text>
<text x="48" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1" opacity="0.6">id → redis</text>
<rect x="110" y="20" width="84" height="50" fill="#c2410c"/>
<text x="152" y="40" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">JWT</text>
<text x="152" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">signed payload</text>
<text x="100" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c" letter-spacing="0.14em">POINT · CONTAIN</text>
</svg>
</div>
<h3>JWT vs sessions</h3>
<p>Short access + opaque refresh, server sessions, and revocation strategies that don't melt the auth DB. The honest tradeoff with names.</p>
<div class="feat-foot"><span>6 stores · revocation</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/grpc-rest-graphql.html">
<div class="feat-num"><span>Chapter 22</span><span class="badge">Deep dive</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="58" height="50" fill="#1a1814"/>
<text x="35" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">REST</text>
<text x="35" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1" opacity="0.6">JSON</text>
<rect x="71" y="20" width="58" height="50" fill="#c2410c"/>
<text x="100" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">gRPC</text>
<text x="100" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">Protobuf</text>
<rect x="136" y="20" width="58" height="50" fill="#1a1814"/>
<text x="165" y="40" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">Graph</text>
<text x="165" y="52" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">QL</text>
<text x="165" y="64" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1" opacity="0.6">SDL</text>
</svg>
</div>
<h3>gRPC vs REST vs GraphQL</h3>
<p>LinkedIn cut 60% latency with Protobuf — and paid a tooling bill for it. Pick the protocol by who's on the other side of the wire, not by hype.</p>
<div class="feat-foot"><span>3 protocols · HotChocolate</span><span class="arrow">↗</span></div>
</a>
</div>
</section>
<!-- ── CASE STUDIES ────────────────────────────────────────────────── -->
<section style="margin-top: 24px;">
<div class="feat-head" id="cases">
<h2>Case <span class="ital">studies</span></h2>
<span class="meta">8 studies · problem · scale · solution · numbers</span>
</div>
<div class="feat-grid">
<a class="feat-card" href="topics/case-discord-cassandra.html">
<div class="feat-num"><span>Case · Discord</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="40" height="22" fill="#1a1814"/>
<text x="26" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">MONGO</text>
<rect x="58" y="34" width="40" height="22" fill="#c2410c"/>
<text x="78" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">CASS</text>
<rect x="110" y="34" width="40" height="22" fill="#c2410c"/>
<text x="130" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">SCYLLA</text>
<rect x="154" y="34" width="40" height="22" fill="#1a1814"/>
<text x="174" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">1T msgs</text>
<line x1="46" y1="45" x2="58" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<line x1="98" y1="45" x2="110" y2="45" stroke="#c2410c" stroke-width="1.5"/>
</svg>
</div>
<h3>Trillion-message database</h3>
<p>Mongo → Cassandra → ScyllaDB. Two migrations. 900 nodes → 177 → 72. The lessons aren't about the databases.</p>
<div class="feat-foot"><span>2015→2023 · 1T msgs</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-figma-postgres.html">
<div class="feat-num"><span>Case · Figma</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="20" width="100" height="50" fill="#1a1814"/>
<text x="56" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="9" fill="#f1ece1">PG 1</text>
<rect x="118" y="20" width="36" height="22" fill="#c2410c"/>
<rect x="158" y="20" width="36" height="22" fill="#c2410c"/>
<rect x="118" y="48" width="36" height="22" fill="#c2410c"/>
<rect x="158" y="48" width="36" height="22" fill="#c2410c"/>
<line x1="106" y1="45" x2="116" y2="31" stroke="#c2410c" stroke-width="1.2"/>
<line x1="106" y1="45" x2="116" y2="59" stroke="#c2410c" stroke-width="1.2"/>
<text x="100" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">VERTICAL → HORIZONTAL</text>
</svg>
</div>
<h3>Scaling Postgres to 4M users</h3>
<p>Vertical first (biggest RDS), then horizontal. Logical shard ID. The migration that didn't leave Postgres.</p>
<div class="feat-foot"><span>2020→2024 · 10× / yr</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-stripe-rate-limiting.html">
<div class="feat-num"><span>Case · Stripe</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="42" height="22" fill="#c2410c"/>
<text x="27" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">RATE</text>
<rect x="54" y="34" width="42" height="22" fill="#c2410c"/>
<text x="75" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">CONCUR</text>
<rect x="102" y="34" width="42" height="22" fill="#1a1814"/>
<text x="123" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">FLEET</text>
<rect x="150" y="34" width="42" height="22" fill="#1a1814"/>
<text x="171" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">ROUTE</text>
<text x="100" y="86" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">FOUR LIMITERS</text>
</svg>
</div>
<h3>Four rate limiters</h3>
<p>Per-user rate. Per-user concurrency. Fleet cap. Per-endpoint backstop. Each catches what the others miss.</p>
<div class="feat-foot"><span>1B+ daily req · Redis Lua</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-netflix-chaos.html">
<div class="feat-num"><span>Case · Netflix</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<circle cx="40" cy="45" r="14" fill="#c2410c"/>
<circle cx="80" cy="45" r="14" fill="#1a1814"/>
<circle cx="120" cy="45" r="14" fill="#c2410c"/>
<circle cx="160" cy="45" r="14" fill="#1a1814"/>
<line x1="40" y1="59" x2="40" y2="74" stroke="#c2410c" stroke-width="2"/>
<text x="40" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#c2410c">KILL</text>
<line x1="120" y1="59" x2="120" y2="74" stroke="#c2410c" stroke-width="2"/>
<text x="120" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#c2410c">KILL</text>
<text x="100" y="20" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">CHAOS MONKEY</text>
</svg>
</div>
<h3>Chaos engineering</h3>
<p>Break it on a Tuesday, not a Sunday. Chaos Monkey → Gorilla → Kong → ChAP. Hypothesise · vary · production · minimise blast.</p>
<div class="feat-foot"><span>2011 → today · 4 principles</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-cloudflare-postgres.html">
<div class="feat-num"><span>Case · Cloudflare</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="34" width="120" height="22" fill="#1a1814"/>
<text x="66" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">55M RPS edge</text>
<line x1="126" y1="45" x2="140" y2="45" stroke="#c2410c" stroke-width="1.5"/>
<rect x="140" y="34" width="54" height="22" fill="#c2410c"/>
<text x="167" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">15× PG</text>
<text x="100" y="86" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">CONTROL PLANE</text>
</svg>
</div>
<h3>55M RPS on 15 Postgres clusters</h3>
<p>Postgres as control plane. Edge as data plane. Partition before shard. pgbouncer or die.</p>
<div class="feat-foot"><span>2023 · 15 clusters</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-hotstar-concurrent.html">
<div class="feat-num"><span>Case · Hotstar</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<line x1="6" y1="76" x2="194" y2="76" stroke="#1a1814" stroke-width="1.5"/>
<path d="M6 70 L 80 68 L 100 50 L 130 14 L 194 18" fill="none" stroke="#c2410c" stroke-width="3"/>
<text x="50" y="40" font-family="JetBrains Mono" font-size="6" fill="#1a1814">PRE-WARM</text>
<text x="140" y="80" font-family="JetBrains Mono" font-size="6" fill="#1a1814">59M concurrent</text>
</svg>
</div>
<h3>59M concurrent viewers</h3>
<p>0 → 25M in 5 minutes. Auto-scaling can't fill that gap. Pre-position. Cache the first 30s. Degrade gracefully.</p>
<div class="feat-foot"><span>2023 · 236 Tbps</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-paypal-actor.html">
<div class="feat-num"><span>Case · PayPal</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<g fill="#c2410c">
<rect x="6" y="26" width="14" height="10"/>
<rect x="22" y="26" width="14" height="10"/>
<rect x="38" y="26" width="14" height="10"/>
<rect x="54" y="26" width="14" height="10"/>
<rect x="70" y="26" width="14" height="10"/>
<rect x="86" y="26" width="14" height="10"/>
<rect x="102" y="26" width="14" height="10"/>
<rect x="118" y="26" width="14" height="10"/>
<rect x="134" y="26" width="14" height="10"/>
<rect x="150" y="26" width="14" height="10"/>
<rect x="166" y="26" width="14" height="10"/>
<rect x="182" y="26" width="12" height="10"/>
</g>
<rect x="6" y="44" width="188" height="14" fill="#1a1814"/>
<text x="100" y="54" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">SHARED THREAD POOL</text>
<text x="100" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">8 VMs · 1B txn</text>
</svg>
</div>
<h3>1B transactions, 8 VMs</h3>
<p>Akka actors over Java/Tomcat. 50 VMs → 8. The concurrency primitive is the architecture.</p>
<div class="feat-foot"><span>2014–2018 · Scala + Akka</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-shopify-flash.html">
<div class="feat-num"><span>Case · Shopify</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="6" y="14" width="92" height="22" fill="#1a1814"/>
<text x="52" y="29" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">POD 1</text>
<rect x="6" y="40" width="92" height="22" fill="#1a1814"/>
<text x="52" y="55" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">POD 2</text>
<rect x="6" y="66" width="92" height="20" fill="#1a1814"/>
<text x="52" y="80" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">POD …</text>
<rect x="106" y="14" width="88" height="72" fill="#c2410c"/>
<text x="150" y="42" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">Rails</text>
<text x="150" y="56" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">monolith</text>
</svg>
</div>
<h3>Black Friday on a monolith</h3>
<p>32M RPM peak. Pods + cell architecture. Each merchant lives in one pod. No microservices. The counter-example.</p>
<div class="feat-foot"><span>2022 BFCM · 533k RPS</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-uber-nearby.html">
<div class="feat-num"><span>Case · Uber</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<g fill="#c2410c"><polygon points="60,20 90,20 105,45 90,70 60,70 45,45"/></g>
<g fill="#1a1814"><polygon points="120,20 150,20 165,45 150,70 120,70 105,45"/></g>
<g fill="#c2410c"><polygon points="120,80 150,80 165,105 150,130 120,130 105,105" transform="translate(0,-50)"/></g>
<text x="100" y="14" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">H3 HEX GRID</text>
</svg>
</div>
<h3>"Nearby drivers" at 1M RPS</h3>
<p>H3 hexagonal grid. In-memory spatial index. Shard by hex prefix. Adaptive resolution for hot zones.</p>
<div class="feat-foot"><span>1M RPS · 7M drivers</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-instagram-scale.html">
<div class="feat-num"><span>Case · Instagram</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="40" y="14" width="120" height="62" fill="none" stroke="#1a1814" stroke-width="3" rx="10"/>
<circle cx="100" cy="45" r="18" fill="none" stroke="#c2410c" stroke-width="3"/>
<circle cx="140" cy="26" r="3" fill="#c2410c"/>
<text x="100" y="84" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">DJANGO · 2.5B</text>
</svg>
</div>
<h3>2.5B users on a Django monolith</h3>
<p>Postgres sharded by user-id. 8192 logical shards embedded in the primary key. Memcached for the feed.</p>
<div class="feat-foot"><span>since 2010 · still Python</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-slack.html">
<div class="feat-num"><span>Case · Slack</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<g><rect x="14" y="14" width="40" height="62" fill="#1a1814"/><text x="34" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">WS 1</text></g>
<g><rect x="60" y="14" width="40" height="62" fill="#c2410c"/><text x="80" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">WS 2</text></g>
<g><rect x="106" y="14" width="40" height="62" fill="#1a1814"/><text x="126" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">WS 3</text></g>
<g><rect x="152" y="14" width="40" height="62" fill="#c2410c"/><text x="172" y="48" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#f1ece1">WS N</text></g>
</svg>
</div>
<h3>Workspace-sharded chat</h3>
<p>Per-workspace MySQL + Solr. WebSocket fleet (flannel). Lazy presence. The cell-architecture predecessor.</p>
<div class="feat-foot"><span>~32M DAU · 12M concurrent</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-google-docs.html">
<div class="feat-num"><span>Case · Docs</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="20" y="14" width="160" height="62" fill="#1a1814"/>
<line x1="30" y1="30" x2="170" y2="30" stroke="#f1ece1" stroke-width="1"/>
<line x1="30" y1="42" x2="140" y2="42" stroke="#f1ece1" stroke-width="1"/>
<line x1="30" y1="54" x2="160" y2="54" stroke="#c2410c" stroke-width="2"/>
<line x1="30" y1="66" x2="120" y2="66" stroke="#f1ece1" stroke-width="1"/>
<circle cx="100" cy="54" r="3" fill="#c2410c"/>
<circle cx="140" cy="54" r="3" fill="#c2410c"/>
</svg>
</div>
<h3>Real-time collaborative editing</h3>
<p>Operational Transformation in 2007. CRDTs as the modern alternative. Convergence is the entire engineering problem.</p>
<div class="feat-foot"><span>OT vs CRDT · billions of docs</span><span class="arrow">↗</span></div>
</a>
<a class="feat-card" href="topics/case-bitly.html">
<div class="feat-num"><span>Case · Bitly</span><span class="badge">Case study</span></div>
<div class="feat-svg">
<svg viewBox="0 0 200 90" preserveAspectRatio="xMidYMid meet">
<rect x="14" y="34" width="76" height="22" fill="#1a1814"/>
<text x="52" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="8" fill="#f1ece1">bit.ly/Abc</text>
<line x1="90" y1="45" x2="110" y2="45" stroke="#c2410c" stroke-width="2"/>
<rect x="110" y="34" width="76" height="22" fill="#c2410c"/>
<text x="148" y="49" text-anchor="middle" font-family="JetBrains Mono" font-size="6" fill="#f1ece1">long URL</text>
<text x="100" y="20" text-anchor="middle" font-family="JetBrains Mono" font-size="7" fill="#c2410c">10B clicks/mo</text>
</svg>