Cravings
March 19, 2007
So, I am sitting in the office on an Indian public holiday staring at 5 dead mosquitoes on my desk. Yes, I killed them after great effort. Bastards. With the amount of these things here on the ground floor, I can easily have a nice pile in a week. It’s OK – they’re just mosquitoes – no one likes mosquitoes, unless they are dead. Bastards.
Anyway, totally unrelated to the mosquitoes… ever have a craving for a particular type of food? Well, forget pregnant women – of course you did! And, I have them all the time too, and most of the time I can satisfy myself. Dominos, Subway, Curd Rice (it’s an Indian thing), mmmmm… But one that pops up now and then … and now especially… is the craving for some Mexican food – some nice bean burritos with melted cheese. At UCI, I would have just taken a 10 min walk down to the Taco Bell or Del Taco right next door (although I used to like Taco Bell while there, now that I think about it, I think I actually liked the Del Taco better). And I used to do it a lot. But damn it! No Mexican place for kilometers in this place.
Anyone living in Pune know any Mexican places?
Design patterns (and large-scale web sites)…
March 6, 2007
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).
Some very disturbing news (not really)…
March 6, 2007
So, ever since the “incident“, I always used to get a shudder everytime I happen to connect the laptop into a power outlet that didn’t work. Everytime I connected the thing and the little charging indicator didn’t come on, I would start freaking out. Oh my god! Not again! You get the idea. But then I plug it into a nearby outlet, and it starts working again. Phew! What a relief!
Well, now, the damn thing actually stopped working. ARRGGGHHH!! It happened early morning on … well, that doesn’t really matter. What matters is that IT STOPPED WORKING … AGAIN!!! Now the people at Toshiba won’t replace it because its out of warranty by a couple of months. I’m thinking faulty power adapters but I still have to go buy me another one of those. Maybe in 3-4 months, I will have to buy another one after that.
Wonderful. Thanks Toshiba. You Guys Suck.