Understanding service architecture
In Chapter 8, Building and Securing Web Services Using Minimal APIs, you learned how to build a web service using ASP.NET Core Minimal APIs. Before looking at alternative technologies to build services, it is worth taking a step back and reviewing service architecture and what causes bottlenecks in service performance and scalability.
What parts of a system are slowest?
Traditionally, the slowest parts of a system are:
- The network (slowest)
- The disk
- Memory
- CPU cache memory (fastest)
Each step can be 5 to 10 times slower than the next.
However, networks are much faster than they used to be, and systems often run within remote data centers. Imagine your service needs some data. Is it faster to read from the local server disk or to make a call to another server?
- Server-to-server call within the same data center: 500,000 nanoseconds (ns)
- Disk seek: 10,000,000 ns