Wednesday, September 19, 2012

Example: Imgur


Imgur is a well built, image hosting site specifically built for high traffic. The developer mainly built Imgur in response to so many existing image hosting sites going down because that image link was posted to Reddit and also other hosting sites compressing content. He described his invention as "an image hosting service that doesn't suck". Because it excelled at providing links in high traffic, it soon became the number one image hosting site on Reddit and soon spread to other sites as well. 
Backend:
Most other image hosting sites are very basic and don't have very high tolerance to high bandwidth requests. Because of this, the hosts either get taken down or the image gets removed because of the high traffic. Imgur solved this problem by running through a series of steps:
  1. The request first goes through a load balancer to try and find a cached version of the page
  2. If no cached page is available it then heads over to an haproxy for cluster sorting (www, uploading, api, image serving, mysql, etc), in the case of an image view, it goes straight to the CDN servers. 
  3. The clusters then bounce around and gather all the information that is needed for the page and caches it. If the CDN server doesn't have the image cached, it is then cached on the CDN for later requests.
  4. The request is then bounced back to the load balancer to then find that recently cached page and then is served to the user. In the case of image views however, the CDN serves the user directly instead of going back through the load balancer
This setup has worked well for Imgur to provide near constant uptime for all images while serving high traffic. They also have an api which allows developers to interface with Imgur directly to develop browser extensions, etc.
More information on the servers and hardware here.
The good:
Imgur stays very basic in terms of user interface which in my opinion goes over very well. When you first open the site, it is very clear where you can go to upload a picture or to browse the most recent pictures uploaded to the site. Imgur makes full use of scripting and supports multiple file upload as well as drag and drop and clipboard upload. You can also upload pictures directly from other websites by just using a URL. As I said above, Imgur's success came from its ability to handle high traffic. Most other websites, imageshack, tinypic, photobucket, were not suitable for Reddit and were quite unreliable with their content being lost after a given amount of time. Imgur has also interfaced with Reddit and allows you to browse images pertaining to that specific subreddit all inside Imgur. This allows for quick viewing of similar images without having to go back to the specific subreddit each time. 
Imgur also allows you to edit and arrange your images when you upload them. It has many great tools to touch up and crop your photos in the website and then publish them for a link. The album feature also allows you to group your vast amounts of photos into albums with the ability to provide titles and comments to each picture.
The bad:
While all sites, Imgur is not perfect. It can handle traffic much better than other websites however it is still prone to being taken down. There are a few times that imgur can become slow due to maintenance and other high volumes of traffic and also goes down a few times. Other than that, there isn't anything else wrong with Imgur.

No comments:

Post a Comment