Saturday, August 21, 2010

Stackexchange: Effect of URL naming scheme on DNS

Stackexchange creates a website for specific topics. People can post and respond to questions related to specific topics. The websites are highly dynamic with a good community waiting to respond to your questions so you get responses quickly.

Looks good.
The following is the link to the stackexchange site for Unix.
unix.stackexchange.com/questions

Once a topic gets voted enough, a website is created for it. Lots of websites already.


But the bad thing is the URL naming scheme. All DNS queries for all topics would go to Stackexchange DNS server and it needs to maintain a record for each topic. After the DNS response is received the browser will establish a new connection to the stackexchange servers. Lots of handshakes.

I feel at least the DNS query step could be made better by creating all topics in the domain of stackexchange.com. That way the local DNS servers (at the ISP) could cache the IP of the stackexchange server and only the usual TCP handshakes would go to the stackexchange servers.

Interestingly Google tried this long ago by giving a domain to each user and I created a domain by the name iamrohitbanga.googlesites.com but soon they moved all google sites users to URLs of the type sites.google.com/site/iamrohitbanga/.
Even wordpress does the same by giving each user a separate domain name managed by wordpress.com.

So wordpress.com not only has to manage user pages but also the DNS records for each user and respond to DNS requests for each connection that wants to read the blog.

Any ideas which design strategy is better?