Caching
Caching reduces latency and speeds up a system. We will store data in a different location than where it was originally being accessed so that it will be accessed faster. When do we need caching? 1) We have clients repeating the same network requests. For example, Graphql can cache data on the client side so that we can avoid fetching the same requests repeatedly or We can cache static data like css/html on the client's browser on first load. 2) We perform computationally expensive operations. We can cache it to avoid doing the same operation and speed up the system. 3) We have multiple servers accessing the same data from a database. We can avoid this by having the servers fetch from a cache instead of the database or maybe we can setup the cache on the server side. Caching when writing: When you are making write or edit requests, you may run into a problem with having 2 sources of truth. For example, you may have a cache of the data on the server as well as having it on th...