How do you imagine cash registers work these days? With 5,000 stores worldwide, 40k servers is 8 computers per store, which doesn't seem excessive to me.
5000 stores, let's say 10 checkout lines per store, just to overprovision, so at worst 50000 simultaneous transactions going on, but probably way less. You can do that with a single server, but you'd want some redundancy and spare capacity.
I worked with a Danish retailer with +3000 store in ~50 countries, and even adding their webshop on top and they were closer to 200 (maybe 300) servers (most VMs). Then you need the ActiveDirectory, office IT, all that stuff, with redundancy and it adds up quickly... but not to 40K.
What I will say that people forget is that production might be 8 beefy VMs, you still need to replicate that to a number of test systems, staging environments and so on. So a 8 node production cluster because maybe 24 servers when accounting those other environments.
I'd assume most of the big supermarkets have a 4-5 host cluster with the small local stores having a 2-3 host cluster. You've got the software to run the tills sure, but also the loyalty card system (which seems to have a local cache at each site based on how quickly it returns your first name), VoIP, Door Access systems, BMS, Digital Signage, Scan as you shop systems, CCTV, Stock management systems..
I imagine that cash registers have the cpu power of at least a cellphone and that they can store transactions over internet in the central company database.
at Tesco scale you really dont want a central database even if its big and high availability. if one store loses connection because of isp issues it would shut down everything and make it impossible to serve customers in that location. a global outage would cost billions. latency is also a big deal when you got a crowd lining up in front of every checkout lane and the self serve machines, at that point it can even turn into a safety/liability issue.
and dont forget that different countries have different rules about customer private data and payment information. if you send eu customer info into the uk for processing you might be breaking privacy laws. some places do automatic tax reporting where you need to send info to a country specific tax office api, get back a code and print it on the receipt.
cash registers dont work alone. its connected with inventory management, employee perf monitoring, payment processing and other things that make more sense as a store local service sending regular reports to corporate instead of waiting for round trips on every operation.
I worked with a Danish retailer with +3000 store in ~50 countries, and even adding their webshop on top and they were closer to 200 (maybe 300) servers (most VMs). Then you need the ActiveDirectory, office IT, all that stuff, with redundancy and it adds up quickly... but not to 40K.
What I will say that people forget is that production might be 8 beefy VMs, you still need to replicate that to a number of test systems, staging environments and so on. So a 8 node production cluster because maybe 24 servers when accounting those other environments.