Increasing performance with caches
Before we analyze the application’s CPU and memory needs, let’s look at where easy wins are possible to return faster responses to the client. By checking telemetry information (as we did in the previous chapter), we can see that when using distributed tracing to send a game move, several requests are made to the database. Figure 12.1 shows the bot sending the SetMoveAsync request:
Figure 12.1 – Tracing a move set
As shown in the preceding figure, when receiving a PATCH request, the game ID is used to retrieve the game from the database to verify the correctness of the data that’s received. After the move is calculated, the resulting game is written to the database. Trace information from EF Core is shown with the DATA keyword, along with the time needed for access.
Performance might be good enough, but this also depends on the database load. When using the SQL Server database, having many...