Title page....11
Copyright....12
Preface....13
How the book is organized....14
How each idea is taught....15
The seven-step framework....16
The code....17
How to use it....18
I Foundations....19
1. Thinking in Systems: The Design Process and Estimation....20
1.1 Learning objectives....20
1.2 Why senior developers struggle with system design....20
1.3 Functional and non-functional requirements....21
1.4 The seven-step framework....22
1.5 Back-of-envelope estimation....23
1.6 Latency numbers every engineer should know....25
1.7 Worked example: scoping Design Twitter....27
1.8 Summary....29
1.9 Review questions....29
1.10 Further reading....30
2. How Requests Travel: Networking and API Styles....31
2.1 Learning objectives....31
2.2 What happens when you press Enter....31
2.3 TCP, UDP and QUIC....33
2.4 HTTP versions and what changes for your design....34
2.5 API styles compared....35
2.6 Server push: WebSockets, SSE and long polling....35
2.7 Designing a good API contract....36
2.8 Worked example: orders and a live trade dashboard....39
2.9 Summary....40
2.10 Review questions....41
2.11 Further reading....41
3. Scaling Out: Stateless Services, Load Balancers, Gateways and CDNs....43
3.1 Learning objectives....43
3.2 Vertical vs. horizontal scaling....43
3.3 Stateless services....44
3.4 Load balancing....46
3.5 Reverse proxies and API gateways....49
3.6 CDNs and edge caching....51
3.7 Mapping to Azure....51
3.8 Worked example: scaling out Contoso Shop....52
3.9 Summary....53
3.10 Review questions....54
3.11 Further reading....54
4. Availability and Reliability by the Numbers....55
4.1 Learning objectives....55
4.2 SLIs, SLOs, SLAs and error budgets....55
4.3 The nines....56
4.4 Composite availability....57
4.5 Redundancy and failover....58
4.6 Worked example: order API on App Service, SQL and Redis....59
4.7 Summary....60
4.8 Review questions....61
4.9 Further reading....61
II Data....62
5. Indexes, Transactions and Isolation Through a Design Lens....63
5.1 Learning objectives....63
5.2 Indexes as a design decision....63
5.3 Designing indexes from access patterns....64
5.4 ACID....65
5.5 Isolation levels and anomalies....66
5.6 MVCC and SQL Servers row versioning....69
5.7 Worked example: a funds transfer....71
5.8 Summary....73
5.9 Review questions....74
5.10 Further reading....74
6. Beyond Relational: Storage Engines and NoSQL Families....75
6.1 Learning objectives....75
6.2 B-trees vs. LSM trees....75
6.3 Write amplification and compaction....77
6.4 The four NoSQL families....78
6.5 Choosing a store....80
6.6 Worked example: storing ticks for a brokerage....81
6.7 Summary....82
6.8 Review questions....83
6.9 Further reading....83
7. Replication and Partitioning....84
7.1 Learning objectives....84
7.2 Leader-follower replication....84
7.3 Multi-leader and leaderless replication....85
7.4 Replication lag in practice....86
7.5 Partitioning....88
7.6 Consistent hashing and resharding....89
7.7 Worked example: sharding a SaaS by tenant....91
7.8 Summary....93
7.9 Review questions....93
7.10 Further reading....94
8. CAP, PACELC and Consistency Models....95
8.1 Learning objectives....95
8.2 CAP, stated precisely....95
8.3 PACELC....97
8.4 A ladder of consistency models....98
8.5 Consistency in Cosmos DB....99
8.6 Worked example: choosing per feature....101
8.7 Summary....102
8.8 Review questions....102
8.9 Further reading....103
9. Caching: Patterns, Pitfalls and the .NET Cache Stack....104
9.1 Learning objectives....104
9.2 Why cache, and where....104
9.3 Caching patterns....105
9.4 TTL, eviction and sizing....107
9.5 The .NET cache stack....108
9.6 Invalidation and consistency....109
9.7 Cache failure modes....110
9.8 Worked example: caching a product catalog API....113
9.9 Summary....115
9.10 Review questions....115
9.11 Further reading....115
10. Blobs, Search and Data Modeling for Scale....117
10.1 Learning objectives....117
10.2 Object storage....117
10.3 Search engines....120
10.4 Denormalization and materialized views....121
10.5 CQRS....122
10.6 Event sourcing....123
10.7 Worked example: a ledger audit trail....123
10.8 Summary....124
10.9 Review questions....125
10.10 Further reading....125
III Asynchronous and Distributed Systems....126
11. Messaging: Queues, PubSub, Streams and Delivery Guarantees....127
11.1 Learning objectives....127
11.2 Why asynchronous messaging....127
11.3 Queues vs. pubsub....128
11.4 Logs and Kafka....129
11.5 Delivery semantics....131
11.6 Idempotency....132
11.7 Poison messages and DLQs....135
11.8 Worked example: trade events to several consumers....136
11.9 Summary....137
11.10 Review questions....138
11.11 Further reading....138
12. Distributed Transactions: 2PC, Sagas and the Outbox....139
12.1 Learning objectives....139
12.2 The dual-write problem....139
12.3 Two-phase commit....140
12.4 Sagas....141
12.5 The transactional outbox....143
12.6 Worked example: an orchestrated trip saga....145
12.7 Summary....147
12.8 Review questions....147
12.9 Further reading....147
13. Agreement and Order: Consensus, Time and IDs....149
13.1 Learning objectives....149
13.2 Why consensus....149
13.3 Raft in one diagram....150
13.4 Split brain, leases and fencing tokens....151
13.5 Clocks and ordering....152
13.6 Generating IDs....153
13.7 Worked example: sortable order IDs....156
13.8 Summary....157
13.9 Review questions....157
13.10 Further reading....158
14. Protecting the System: Rate Limiting and Resilience....159
14.1 Learning objectives....159
14.2 Rate-limiting algorithms....159
14.3 Rate limiting in ASP.NET Core....160
14.4 Distributed rate limiting....162
14.5 Resilience patterns....162
14.6 Polly v8 and Microsoft.Extensions.Http.Resilience....165
14.7 Retry storms and load shedding....166
14.8 Worked example: the quotes API....167
14.9 Summary....168
14.10 Review questions....168
14.11 Further reading....169
15. Architecture Styles and Service Infrastructure....170
15.1 Learning objectives....170
15.2 The costs of distribution....170
15.3 Modular monolith first....171
15.4 Bounded contexts....172
15.5 Service infrastructure....174
15.6 Aspire, Dapr and Istio....176
15.7 Worked example: cutting a fintech platform into modules....177
15.8 Summary....178
15.9 Review questions....179
15.10 Further reading....179
16. Batch, Streams and Observability....180
16.1 Learning objectives....180
16.2 Batch processing....180
16.3 Stream processing....181
16.4 Lambda and Kappa architectures....183
16.5 Observability....184
16.6 RED and USE metrics....186
16.7 Worked example: tracing an order through three services....188
16.8 Summary....188
16.9 Review questions....189
16.10 Further reading....189
IV Cross-Cutting Concerns....191
17. Identity and Security by Design....192
17.1 Learning objectives....192
17.2 Authentication vs. authorization....192
17.3 OAuth 2.0 and OpenID Connect....193
17.4 JWTs and refresh tokens....195
17.5 RBAC vs. ABAC....196
17.6 Encryption and secrets....197
17.7 Multi-tenant isolation....199
17.8 Worked example: a multi-tenant invoicing SaaS....200
17.9 Summary....201
17.10 Review questions....202
17.11 Further reading....202
18. Shipping and Paying: Deployment, Cloud Building Blocks and Cost....204
18.1 Learning objectives....204
18.2 Containers and Kubernetes essentials....204
18.3 Release strategies....207
18.4 Cloud building blocks....209
18.5 Cost as a design constraint....210
18.6 Worked example: pricing the orders platform....211
18.7 Summary....213
18.8 Review questions....213
18.9 Further reading....214
19. Surviving Disaster and Load: Multi-Region, DR and Capacity Planning....215
19.1 Learning objectives....215
19.2 RPO and RTO....215
19.3 Geo-replication and residency....217
19.4 Tail latency....218
19.5 Littles Law and capacity....219
19.6 Load testing....220
19.7 Worked example: DR plan for a payments ledger....221
19.8 Summary....223
19.9 Review questions....223
19.10 Further reading....224
V Case Studies....225
20. Case Studies I: Core Building Blocks....226
20.1 Learning objectives....226
20.2 URL shortener....226
20.3 Distributed rate limiter....229
20.4 Key-value store (Dynamo-style)....232
20.5 Notification system....234
20.6 Summary....236
20.7 Review questions....237
20.8 Further reading....237
21. Case Studies II: Social and Real-Time Systems....239
21.1 Learning objectives....239
21.2 News feed....239
21.3 Chat....242
21.4 Typeahead....244
21.5 Web crawler....246
21.6 Summary....249
21.7 Review questions....249
21.8 Further reading....250
22. Case Studies III: Media, Files, Location and Scheduling....251
22.1 Learning objectives....251
22.2 Video streaming....251
22.3 File sync....253
22.4 Ride-hailing proximity....255
22.5 Distributed job scheduler....258
22.6 Summary....261
22.7 Review questions....261
22.8 Further reading....262
23. Case Studies IV: Money and Contention....263
23.1 Learning objectives....263
23.2 Payment system....263
23.3 Stock exchange....266
23.4 Ticket booking....268
23.5 Leaderboard and metrics....271
23.6 Summary....273
23.7 Review questions....274
23.8 Further reading....274
VI Mastery....275
24. Trade-offs, Design Docs and the Classic Papers....276
24.1 Learning objectives....276
24.2 Design docs and ADRs....276
24.3 Articulating trade-offs....278
24.4 Four classic papers....279
24.5 Worked example: an ADR for the catalog cache....280
24.6 Summary....281
24.7 Review questions....282
24.8 Further reading....282
25. Designing AI Systems....283
25.1 Learning objectives....283
25.2 The RAG pipeline....283
25.3 Vector databases....285
25.4 Serving and cost....286
25.5 Evals and guardrails....287
25.6 Agents....288
25.7 Worked example: internal document Q&A....289
25.8 Summary....290
25.9 Review questions....290
25.10 Further reading....291
26. Capstone: Modernizing a Legacy Fintech Platform....292
26.1 Learning objectives....292
26.2 Current state....292
26.3 Target architecture....293
26.4 Migration plan....294
26.5 Risks and governance....296
26.6 Worked example: switching payments....297
26.7 Summary....298
26.8 Review questions....298
26.9 Further reading....299
27. The Design Interview and Your Path Forward....300
27.1 Learning objectives....300
27.2 The 45-minute structure....300
27.3 Two mock prompts....301
27.4 Self-review rubric....302
27.5 Where to go next....302
27.6 Summary....303
27.7 Review questions....303
27.8 Further reading....304
Glossary....305
A....306
B....308
C....309
D....311
E....312
F....313
G....314
H....315
I....316
J....317
K....318
L....319
M....321
N....322
O....323
P....324
Q....326
R....327
S....329
T....331
U....333
V....334
W....335
Index....336
You already know how to build software. Learn to decide what should exist, how it should scale, and what happens when it fails.
System Design for .NET Engineers is a practical guide for experienced developers preparing for architecture decisions, design reviews, and system design interviews. It connects distributed systems principles to familiar C#, ASP.NET Core, SQL Server, and cloud examples.
Follow a repeatable seven-step framework: requirements, estimates, API, data model, high-level design, deep dive, and trade-offs. Across 27 chapters, explore scaling, storage, consistency, caching, messaging, resilience, security, deployment, cost, and disaster recovery.
Apply those ideas to 16 case studies, from URL shorteners and chat to payments and ticketing. Then work through AI system design and a legacy fintech modernization capstone. Diagrams, calculations, code examples, review questions, and further reading support a structured 60-hour study plan.
Build the judgment to explain your choices, recognize failure modes, and defend an architecture with clear trade-offs.