為什麼Facebook時間軸使用Mysql
首先,請瞭解一個關於Facebook 時間軸不太被眾人所知曉的一個事實:它採用Mysql資料庫,一個最初被設計成管理少數機器之間被少量應用所使用的一個資料庫管理系統。和一個有著8億多使用者,作為世界上第一大社交網站相比,這是怎麼做到的呢?
來自即將接管Facebook紐約工程院的Wired和Serkan Paintino的一份報告透露,Facebook使用mysql是為了協助時間軸定址記憶體需要,因為時間軸的工作原理完全不同與新聞訂閱。
因為時間軸相比於及時地展示更新更注重組織資料,Mysql很適合處理這種應用。儘管資料聚集在儲存的地方(如不通過網路連接),但是資料由Mysql管理,而是不由諸如NoSQL或Hadoop Hbase(HadoopHBase是ApacheHadoop項目一部分,詳見http://developer.51cto.com/art/201006/203661.htm)。
Paintino告訴Wired說:“很多人對Facebook時間軸這個新的功能很吃驚,而且我們還採用Mysql,事實上我們把mysql當作一個很通用的資料處理引擎。並將他作為資料存放區引擎使用。事實上mysql是效率很高的。”。
儘管Piantino將它作為一種選擇,但是這有時候會超出某種需要。MySQL自從開源之後便成為了小型系統的理想的資料存放區方案,但是Facebook被認為過於依賴MySQL,對於一個由哈佛學生在寢室裡建立的社交網站(Facebook)這貌似很完美。
但是,MySQL並不適合作為一個大型的數字化的公司的即時資訊的資料庫平台。Derrick Harris在GigaOm網站上一片文章中列舉除了關於Facebook依賴MySQL導致的一連串的問題。同時在GigaOm網站上資料庫界權威Micheal Stonebreaker 稱這件是會讓Facebook命運比死亡還可怕。
Facebook一直致力於改善自身的Mysql使用。甚至還有專門關於相關問題的頁面,而且很活躍,參與人員超過74000人。
你是怎麼看待facebook使用mysql,尤其是時間軸這一方面,這是一顆會爆炸的定時炸彈,還是對現有技術的合理使用,請留下評論讓我們知道你的看法。
原文:
Why Facebook Uses MySQL for Timeline
A little-known fact about Facebook Timeline: It relies on MySQL, a database-management system that was originally designed to be used in small-scale applications on just one or a few machines — a far cry from the 800+ million users of the world’s largest social
network. What gives?
In this report from Wired, Serkan Piantino, who will be in charge of Facebook’s New York engineering office, reveals that Facebook turned to MySQL to help address the memory needs of Timeline, since it works in a fundamentally different way from the news feed.
Since Timeline is more concerned about organizing data neatly than shooting out updates in real time, MySQL is well suited for the app. Although the data is aggregated in the same location as the data is kept (i.e. not over a network connection), that data
is managed by MySQL, and not an alternative like NoSQL or Hadoop Hbase.
“A lot of people are surprised that for this shiny new thing for Facebook, we’re using MySQL,” Piantino told Wired. “We treat [MySQL] as a generic engine for data manipulation. We use it as a storage engine. And it’s really efficient.”
Although Piantino frames it as a choice, it could have been made out of necessity. Facebook is thought to rely heavily on MySQL, which is ideal for a small system since it’s open source and free. Perfect for an ambitious Harvard student starting a social network
in his dorm room.
However, MySQL isn’t something a massive digital company would pick as its go-to database platform. Derrick Harris expertly lays out the larger issues of Facebook relying on MySQL in this article at GigaOm, where database guru Micheal Stonebreaker calls it
a “fate worse than death.”
Facebook is constantly working on improving its MySQL implementation, however, and even has a page dedicated to the issue. It’s quite active, and has over 74,000 members.
What do you think of Facebook’s use of MySQL, and with Timeline specifically? Is it a time bomb waiting to happen, or a savvy use of existing technology? Let us know in the comments.
譯文並沒有完全採用直譯,由於時間倉促加之本人能力有限,如有錯誤,請指出。
更多技術文章請訪問:thinkblog.sinaapp.com