When the speed of light is too slow
I'm currently working on a Real Time Bidding system. Basically, when someone visits a Web page, that page may cause a bid request to be sent out to multiple ad bidders and they bid on who gets to place the ad. For my system, I have to respond withing 100 milliseconds to be eligible to participate in the auction. That's when life gets interesting.
Currently my code evaluates a bid request, selects an appropriate creative (advertisement) and responds within 1 to 3 milliseconds. Given that I need to respond within 100 milliseconds, that should be fine.
You see, I like to make sure that my code actually works (silly me). The company we're working with has a data center in Amsterdam, but their closest data center with a sandbox is in New York City. Given that the speed of light travels at roughly 300,000 km/s and New York and Paris (where our our servers are) are almost 6,000 kilometers apart and have a round-trip speed of light travel time of roughly 40 milliseconds, you might think I still have plenty of time to respond.
Unfortunately, that speed of light is the speed of light in a vacuum. My response is going over fiber, is not going in a straight line and is passing through multiple bits of hardware.
Despite my responding in 1 to 3 milliseconds, my responses are taking around 250 to 500 milliseconds to reach the New York sandbox. It is simply not possible for me to submit a winning bid from our servers in Paris. As a result, while I can demonstrate that my code can talk to their code, I cannot run a successful test. Until this company sets up a sandbox in Amsterdam, we're going to have to spend money to set up a server in the US.
We've considered an Amazon cloud instance, though I think a cheap Linux box with root access should be fine. I'm not sure yet of the pros and cons. Suggestions welcome.