The banks use a computation process called batch processing. Some types of repetitive tasks i.e. filtering, sorting, backups, etc. can be resource heavy on the components of a system. So, they take all those transaction requests, store them on a server somewhere, then at 2am, they all process. So when few people are likely to be online and accessing the banks website, servers, etc, the computers just run all the transactions since they have the most computational resources likely available.
If they had to process transaction requests as they came in, the possibility exists that there would be few, if any, resources left to run the rest of the bank and there would be lag elsewhere. Additionally, if too many people tried to process a transaction at once, the bank may inadvertently run into a denial of service attack. Usually this is done purposefully by malicious persons to shut down a system. What happens is too many requests are sent at once and the computer can’t handle it. So it just shuts off or reboots. So again, to avoid this, the bank will have all those transactions process overnight, and will have instructions for the computer to only process as many as it can handle without killing itself. Might take some time to process all those transactions, but hey, we’re all either asleep or partying when it happens.
Edit: some of my answer comes directly from Google. Had to search for a quick refresh and correct verbiage. Used to work in IT.
Latest Answers