When you run multiple origins — US-East, EU-West, APAC — the client's country and ASN tell you which one to hit. IP-Atlas MMDB makes that lookup a memory read, not a network round trip.
| Field | Use |
|---|---|
country | Continental routing — US → us-east, CN → apac, etc. |
asn | Shortcut for edge-network peerings — e.g. prefer GCP origin for Google ASN clients. |
is_datacenter | Don't treat a server-to-server call as a human session; route to API-origin, not CDN-origin. |
latitude, longitude | Nearest-origin selection when you have many PoPs. |
// Cloudflare Worker — pick origin by country const ORIGIN = { US: 'https://us-east.app.example.com', GB: 'https://eu-west.app.example.com', JP: 'https://apac.app.example.com', DEFAULT: 'https://us-east.app.example.com' }; export default { async fetch(req, env) { const ip = req.headers.get('cf-connecting-ip'); const r = await env.IPATLAS.lookup(ip); // KV-cached wrapper const target = ORIGIN[r.country] || ORIGIN.DEFAULT; return fetch(target + new URL(req.url).pathname, req); } };
# nginx.conf — ngx_http_geoip2_module
load_module modules/ngx_http_geoip2_module.so;
geoip2 /etc/nginx/ipatlas-2026-04.mmdb {
$geo_country country;
$geo_asn asn;
}
server {
location / {
proxy_pass https://origin-$geo_country.internal;
}
}
Memory-mapped MMDB lookup is ~800 ns. On a box handling 50K RPS that's less than 0.1% CPU.