Nearest instance of an app through 6PN?

Hey there,

We’re planning on deploying a geo-replicated redis app for caching, and wanted an easy way for our apps to talk to the nearest redis server. Accessing the “nearest” instance through the public anycast IP is straightforward, but I was wondering if there was anything similar for 6PN? If this isn’t possible, what’s the best workaround (other than exposing redis publicly, which we really don’t want to do)? For a bit more context, we expect to have our frontend app deployed to far more regions (scaling up and down dynamically using autoscaling) than the redis app (fixed set of instances), so we don’t want to go with naming regions and stuff in configs.

I need to check on this, we may have a DNS lookup that’ll get you the nearest 6pn but I’m not positive we shipped that yet. We’ll see what we can find tomorrow.

How many requests do you expect to hit Redis? And how much cache data do you think you’ll have? I think most apps will be faster if the app processes live in the same regions as Redis. The simplest setup might be to scale up and down within the same regions Redis is running in.

Our frontend nodes have an in-memory cache (with a shorter TTL), redis acts as a secondary cache, with a higher TTL, which allows us to use a stale-while-revalidate pattern where stuff expires out of our in-memory cache → we grab the cached value from redis and trigger a background refresh if needed (which writes to the redis master). Load on redis is minimal, this is primarily to give us a bit of resiliency against backend failures as well as reduce P99 latency.

Our frontend app will be deployed to far more regions than redis will be (since ideally most users will get a response from the in-memory cache), but ideally we’d have redis replicas on each continent.

Thanks for the quick response!

Ah! That make sense. Local, in process caching is basically my favorite thing to do on Fly.

We haven’t shipped “get nearest IP” in DNS yet but it should be out very soon. We have a new internal DNS service in our dev environment getting a good run through right now!