OSCON2006: Databases and Caching

I often get accused of being cache centric in my ideas on performance. As I attend OSCON this year I have kept my ear out, both in and out of the sessions, for how everyone is solving performance problems.
There seems to be couple of themes. One is to keep as much away from your database as possible. Another is to do this by using caching. In the LAMP world this generally means using memcached. You can also use mod_proxy for this, and Squid. I am not really sure why memcached is used in preference to these two but I intend to find out.
Another alternative is to replicate data between databases. This also seems less popular. The scalability tutorial speaker was of the view that this is relatively hard, though of course practical. If you are talking commercial databases, you also have cost problems. The general solution here, is say you have Oracle, replicate to read only MySQL servers.
But solutions like memcached, and write through cache solutions such as the approach taken by the very movable type I am using right now are simpler.
The SleepyCat founder was a the Keynote this morning. He suggested that some of the larger shops such as Amazon and Google use SleepyCat rather than client server database servers like Oracle or MySQL.
Another interesting comment was that when MySpace was moved from ColdFusion to ASP.net, the caching piece had to be custom written and was inspired by memcached.
So, I guess to summarise, I would say that a web caching piece is a mandatory part of each stack.

Published
Categorized as Software

By Greg Luck

As Terracotta’s CTO, Greg (@gregrluck) is entrusted with understanding market and technology forces and the business drivers that impact Terracotta’s product innovation and customer success. He helps shape company and technology strategy and designs many of the features in Terracotta’s products. Greg came to Terracotta on the acquisition of the popular caching project Ehcache which he founded in 2003. Prior to joining Terracotta, Greg served as Chief Architect at Australian online travel giant Wotif.com. He also served as a lead consultant for ThoughtWorks on accounts in the United States and Australia, was CIO at Virgin Blue, Tempo Services, Stamford Hotels and Resorts and Australian Resorts and spent seven years as a Chartered Accountant in KPMG’s small business and insolvency divisions. He is a regular speaker at conferences and contributor of articles to the technical press.

1 comment

  1. The big advantage i see with memcached over a web proxy like squid is that with memcached we can aggregate the memory of multiple servers, so if we have a web farm of 10 servers and we start a 2Go memcached instance in each, we end up with a pool of 20Go ! The only way to do the same with squid would be to have a dedicated server with like 32Go for it and since you cant afford to loose it, you will have to add another box for redundancy.
    So in the end, to be able to cache the same amount of info, you will need to add the TCO of 2 servers. And when you think servers tend to have more and more memory and you tend to have more and more servers, memcached makes a lot of sense over a traditional approach of a proxy caching.

Comments are closed.