-1

I am trying to make a link shortener resilient to server failure by re-routing to a good server.

Example:

  1. shortener.com/a1b2c3 > forwards to > website1.com

(shortener.com and website1.com are on different dedicated servers)

  1. For argument's sake, lets say the http://shortener.com link is posted to Twitter. So the user journey is twitter.com > shortener.com > website1.com

  2. Can I use DNS or some top layer infrastructure to detect shortener.com server is down and use alternative, to re-route traffic to website1.com?

Link to show diagram of two scenarios

Dazza
  • 13
  • 1

1 Answers1

2

No, the DNS has no concept of systems being up or down. Aside from that, though, if a system like you seek did exist, how would it get its domain mapping information if the shortener itself is down.

With various public cloud providers, the ability to stand up a very highly-available web application like this is approaching trivial status. You should put your efforts into building a highly-available application.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • Some valid points, although the most common cause of the server (cloud-based) being down is corrupt software, so even in a highly-available environment servers still go down.... What about dual-balancing? Or a gateway server before shortener.com ? – Dazza Mar 20 '17 at 13:20
  • Any of that requires your shortening data, which will need to be highly available anyway. Well-tested software combined with good alerting and the ability to quickly deploy fixes mitigates a lot of the chance of downtime. Additionally, putting extra layers of indirection in your application rarely does anything to increase stability. Rather, they introduce more SPOFs for you to manage. – EEAA Mar 20 '17 at 14:10