Ah… design patterns are wonderful aren’t they?

Singletons, Factories, Commands, Proxies, Visitors, Adapters, etc., etc. Yes, especially in designing and developing software, patterns like the trusty GoF are great. They give you a well-recognized, robust, reliable, reusable, flexible, etc. way to approach problems. Well-recognized because if I name something ObjectFactory, it instantly conveys a lot of structural and behavioral information to the seasoned (even the lightly seasoned) Software Engineer. Robust, reliable, reusable, flexible, etc. because well – these patterns have been put through their paces and are the result of refinement through usage in many systems.

But design patterns are not just useful in software systems. It’s easy to miss the beauty of design patterns in other areas. Consider for example, the network architecture for a large scale web site. At first, it seems like a big secret no one is willing to share. Kind of like an Alliance of Magicians. Not to worry though – there’s a few Gobs out there. So who’s coming to the rescue? Well, we start with … Google! Yes, it takes a while to filter through all the crap to get to some solid secrets-revealing but reading through the good stuff, you will again notice that the design for these sites takes the shape of a few common patterns.

So, here is some of the most interesting stuff available: The LiveJournal Backend Architecture (PDF), the Flickr Architecture, and a great series called the Database War Stories over on Tim O’Reilly’s blog (make sure to click on the links at the bottom to read through all the war stories).

Well, so what are the design patterns for the architecture of a large scale site? First are the front-facing web servers headed by load-balancer. On the other side of these web servers are one or more clusters of databases. Within each of these clusters, simple master-slave replication may be setup, or there may be horizontal or vertical data partitioning setup (which may also be across clusters, depending on the exact setup). There may also be a cluster for serving static content (such as files, HTML, etc.). Cache server (ex. memcached) clusters are also possible. The point is: there are clear patterns, and even solutions to easily implement these patterns. I leave it to you to get the details – they are all good reads (if you’re into that kind of thing).

4 Responses to “Design patterns (and large-scale web sites)…”

  1. Nirav Thaker Says:

    These are architectural, rather than design, patterns. You would like to read POSA series of books, or at least articles about them :) and are quite commonly employed.

    OOPSLA discusses lots of it, and if you have access to ACM or IEEE, u’ll find much more on it!

    http://www.google.com/search?q=Distributed+Design+patterns


  2. If you’ve read and liked the GoF book. Perhaps you will also like reading “The Smalltalk Companion”

    And yes, what you talk about is more like Enterprise Patterns, and architectural patterns. Design patterns come some step down from architectural patterns.

  3. Ravi Chodavarapu Says:

    Thanks for pointing out the misuse in terminology. I guess I was trying to link pattern-based thought across different levels of software without thinking much of terminology.

    I think what I am describing can be more closely described as network architecture and data patterns. But, overall, I was going for thinking in patterns.


  4. Not that I’m impressed a lot, but this is more than I expected when I stumpled upon a link on Furl telling that the info here is awesome. Thanks.


Leave a Reply