alternative to environment variables

Posted by tonyl7126 on Programmers See other posts from Programmers or by tonyl7126
Published on 2013-05-30T23:03:52Z Indexed on 2013/06/30 10:27 UTC
Read the original article Hit count: 359

The amount of servers and the complexity of our application is growing and we now have servers in different regions (hosted on AWS). Certain database operations require low latency so we have stuck a database in each region (which is basically a user cache) to keep the network latency low. The way the application server currently knows which user cache/database to make its call to depends on an environemnt variable set in it. This has been working fine, but it seems hacky and not optimal. Is there any way for this to be done automatically?

I was considering using a package like fping and pinging each database when the app server reloads (or caching it the first time) and using the corresponding latencies to decide which database has the lowest latency for each app server. Not sure if this is the best idea though.

© Programmers or respective owner

Related posts about networking

Related posts about configuration-management