Colocation places components that communicate frequently closer together to reduce latency. The first placement decision is often between machines: a nearby database can save more time per request than an application-level optimization. The same principle applies within a machine, where CPU, memory, cache, and network-stack placement affect access time. section 3.1
Move the data closer
A web application querying a database 6,000 km away incurs about 60 ms of network round-trip latency per request. Moving the database into the application's data center reduces query latency to under 10 ms. Embedding a database in the application removes that network communication entirely; a REST API server with embedded SQLite is one such arrangement. section 3.0 section 3.6
Work from the largest communication distances inward:
- Place communicating services closer together. CDNs and edge computing similarly move data or computation toward users. section 3.1 section 3.6
- Then consider multicore placement: keep a CPU core's data on its local NUMA node, and account for cache and network-stack latency. section 3.1 section 3.6
Figure 3.2 Geographic latency. The geographic distance between two nodes implies latency. For example, Hibernia Express advertises 60 ms round-trip between New York and London. Light travels the same distance in vacuum in 19 ms, so the minimum theoretical round-trip latency is 38 ms.
The New York–London comparison shows why distance imposes a latency floor: the cited 60 ms network round trip exceeds the 38 ms theoretical round trip for light in a vacuum. Moving a service closer does not necessarily remove last-mile latency. section 3.2.1

