For most web-based applications, storing data in memory is usually not practical. The data will be wiped out when the application terminates. It’s not a rare case for an application to be terminated, for example, when you want to deploy a newer version of the same application.
Another downside of storing data in-memory is that you may not able to share the data between application instances. We sometimes need multiple application instances for availability and scalability. If one of the instances is down, we still can serve user requests by using the other instances (availability). ...