Many organizations used HSM for their on-premise data center environments. However, when they migrate to the cloud, having HSM on-premise leads to some network bottlenecks. Let's understand why in the following diagram.
In the following scenario, we have the infrastructure in the cloud environment and HSM in the on-premise environment.
Every time the application wants to run operations such as encrypt and decrypt, the data has to be passed through the internet to reach the HSM device and the same for its return path.
This leads to some amount of latency due to the network, which will slow down the overall operation speed of the application: