How Flickr uses PHP, MySQL and Web Services

Submitted by kai on Thu, 2006-03-09 21:45. ::

Moshe Weitzman posted a link to this great presentation “Flickr and PHP” by Cal Henderson in the developer mailing list of Drupal. It's about how Flickr uses PHP, MySQL and Web Services. I found another very similar presentation.

Here's a different one done by Cal at O'Reilly Emerging Technology Conference: Web Services Mash - up

Here is what I took away from these presentations:

  • Scale database access horizontally to handle database update/insert/delete and select separately
  • Serve static data from a standalone server.
  • Replicate searchable data in MySQL ISAM tables just for searching.
  • Don’t try to normalize tables blindly because joins are expensive
  • Shared nothing, everything is in DB, even template caches
  • Web Service API is stateless
  • Safeguard against misuse of APIs
  • Be open. Let others have a chance to manipulate your data through APIs. People are creative. It's free labor when you get people write apps based on your APIs.

I have some questions though:

  • What is the node service really in Flickr’s logical architecture? It seems like an XML-protocol layer to access DB.
  • What kind of web servers (Apache? Lighttpd, thread-based? Process-based?), and how many of them are used? Is any kind of PHP cache optimizer used?
  • He claimed normalization is bad for performance. The following setup came across my mind: the master DB can have all the normalized tables/data, and de-normalized data/tables are constructed in the slave DB. I think whether this works or not depends on how replication works in MySQL. I assume it's fastest to replicate data when the DB structure is the same.
kai
Submitted by kai on Tue, 2006-03-14 14:57.

I found another article on Flickr's use of open source tools. It mentioned that Flickr uses Apache.

David Jensen
Submitted by David Jensen (not verified) on Tue, 2006-03-14 15:20.

Did you see where a 17-year-old programmer creater a "better" Flickr in just 3-months:

http://techcrunch.com/2006/03/11/flickr-has-some-catching-up-to-do/

http://www.zooomr.com/

kai
Submitted by kai on Thu, 2006-03-16 15:11.

Yeah. I got the news of the hype about zooomr a couple days ago. When I was trying to check it out for the past few days, it had been down due to Digg and Slashdot effects. Now it is back online. It looks promising. But it's slow. The article hyped it up just too much.

Flickr won't be sitting still. One of the greatest things about Flickr is its web service API. Just look at the amazing amount of 3rd-party Flickr tools availble here

Post new comment



The content of this field is kept private and will not be shown publicly.


*

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • WikiText is converted to HTML (supported WikiText formatting will show in the long tip format).
Verify comment authorship
Captcha Image: you will need to recognize the text in it.
*
Please type in the letters/numbers that are shown in the image above.