War Stories : LinkedIn.com

Cerita dari garis depan selalu menarik untuk dibaca. Tidak terkecuali cerita-cerita dari garis depan para praktisi IT; dan cenderung lebih menarik karena tidak ada korban jiwa :)
Paling korban server, hehe… anyway.

Beberapa hari yang lalu saya menemukan kisah detail mengenai “jeroan” LinkedIn.com
Saya langsung tertarik - LinkedIn.com adalah satu-satunya social networking website yang saya ikuti. Ya, saya tidak punya account Friendster / Facebook / Orkut / dst. So sue me :)
Sekilas situs LinkedIn.com terlihat sederhana. Namun saya yakin detail internalnya pasti sangat kompleks. Dan saya tidak keliru.

Oren Hurvitz menemukan 2 presentasi dari tim teknis LinkedIn.com di situs SlideShare.net, yaitu sbb :

Oren kemudian membuat ringkasan dari presentasi-presentasi tersebut di blognya.
Dikutip dari http://hurvitz.org/blog/2008/06/linkedin-architecture :

Site Statistics

  • 22 million members
  • 4+ million unique visitors/month
  • 40 million page views/day
  • 2 million searches/day
  • 250K invitations sent/day
  • 1 million answers posted
  • 2 million email messages/day

Software

  • Solaris (running on Sun x86 platform and Sparc)
  • Tomcat and Jetty as application servers
  • Oracle and MySQL as DBs
  • No ORM (such as Hibernate); they use straight JDBC
  • ActiveMQ for JMS. (It’s partitioned by type of messages. Backed by MySQL.)
  • Lucene as a foundation for search
  • Spring as glue

Salah satu komponen di infrastruktur mereka yang paling mencengangkan adalah “The Cloud” :

The Cloud

  • The Cloud is a server that caches the entire LinkedIn network graph in memory.
  • Network size: 22M nodes, 120M edges.
  • Requires 12 GB RAM.
  • There are 40 instances in production
  • Rebuilding an instance of The Cloud from disk takes 8 hours.
  • The Cloud is updated in real-time using the Databus.
  • Persisted to disk on shutdown.
  • The cache is implemented in C++, accessed via JNI. They chose C++ instead of Java for two reasons:
    • To use as little RAM as possible.
    • Garbage Collection pauses were killing them. [LinkedIn said they were using advanced GC's, but GC's have improved since 2003; is this still a problem today?]
  • Having to keep everything in RAM is a limitation, but as LinkedIn have pointed out, partitioning graphs is hard.
  • [Sun offers servers with up to 2 TB of RAM (Sun SPARC Enterprise M9000 Server), so LinkedIn could support up to 1.1 billion users before they run out of memory. (This calculation is based only on the number of nodes, not edges).

Luar biasa ! :D

Presentasi teknis LinkedIn.com kemudian ditutup dengan beberapa scaling tips :

  • Can’t use just one database. Use many databases, partitioned horizontally and vertically.
  • Because of partitioning, forget about referential integrity or cross-domain JOINs.
  • Forget about 100% data integrity.
  • At large scale, cost is a problem: hardware, databases, licenses, storage, power.
  • Once you’re large, spammers and data-scrapers come a-knocking.
  • Cache!
  • Use asynchronous flows.
  • Reporting and analytics are challenging; consider them up-front when designing the system.
  • Expect the system to fail.
  • Don’t underestimate your growth trajectory.

Detail selengkapnya bisa ditemukan di blog Oren Hurvitz, dan di file asli presentasinya.

Selamat menikmati !

15 Responses to “War Stories : LinkedIn.com

  • 1
    Donny Reza
    June 13th, 2008 09:22

    Duh, apa pula inih …? seumur-umur programming, nggak ngerti sama yang di atas itu semua. Partitioning? Cache? Asynchronous? Duh, banyak yang masih harus saya baca … *nyari perpustakaan*

  • 2
    Abe
    June 13th, 2008 11:56

    Hareee gene belum ada akun FS (frenster) dan FB (fesbuk)? Kok bisa ya? :D

  • 3
    R. Iqbal
    June 13th, 2008 17:00

    Terima kasih Pak Harry. Ini adalah posting blog paling menarik (menurut saya) yang saya baca bulan ini

    :-)

  • 4
    sufehmi
    June 13th, 2008 22:32

    @Donny - ini coding level khayangan sih, hehe :)
    .
    Musti tapa 40 hari dulu di gunung kawi sambil puasa mutih…. **oopppsss** :D

  • 5
    sufehmi
    June 13th, 2008 22:33

    @Abe - mohon dimaafkan & dimaklumi ya oom… hihihi
    .
    Maklum, kuper :D

  • 6
    sufehmi
    June 13th, 2008 22:33

    @Iqbal - sama-sama mas :) memang kisah perang seperti ini selalu menarik.
    .
    Well, at least bagi geeks seperti kita ;)

  • 7
    dani jtk
    June 13th, 2008 22:34

    Mas Hary kenapa yach klo system nya dah class entrprise gituu rata2 musti kudu pake solaris untk layer OSnya?apakah *BSD Family gak kalah hebat nya juga?

  • 8
    sufehmi
    June 14th, 2008 07:08

    @dani - tidak semua computer high-end pakai solaris. Komputer tercepat di dunia, Ranger platform, itu menggunakan OS CentOS :) :)
    .
    Beberapa spec Ranger platform :
    .
    # 120 TB (120000 GB) RAM
    # 2 PB (2000 TB = 2000000 GB) disk space
    # 62976 CPU
    # Speed: 500 teraflops
    .
    Perbandingan antara Ranger platform dengan superkomputer lainnya di dunia bisa dilihat disini (note: Ranger yang paling atas) :
    .

    .
    BSD family & Solaris itu sebetulnya masih satu keluarga. Sama-sama bagus saya kira.

  • 9
    Ivan
    June 17th, 2008 00:46

    Wow! Bacaan yang menarik. Menurut saya yah …. orang Indonesia benernya punya bakat. Cuman berhubung tidak ada support (dana) untuk bikin aplikasi segede ini, maka bakat2 tadi nggak tersalurkan.

    Omong2 ..apa beda Nodes ama Edges sih?

    “Network size: 22M nodes, 120M edges.”

    Met kenal Yah! dah ku bookmark! :)

  • 10
    sufehmi
    June 17th, 2008 10:20

    @Ivan - mudah-mudahan dalam waktu beberapa bulan ini akan ada support / dukungan dari pemerintah dalam soal ini ;)
    .
    Node & Edge itu istilah pada Teori Graph : http://en.wikipedia.org/wiki/Graph_(data_structure)
    .
    Agak mengecoh sih istilahnya - edge adalah jalur yang menyambungkan 2 node.
    Makanya jumlahnya lebih banyak daripada node.
    .
    Salam kenal juga ya.

  • 11
    zam
    June 17th, 2008 19:04

    Euleuh. euleuh… puyeng bacanya…. masih blm kebayang euy… he.. he..
    .
    Pak Harry, mau tanya nih, maaf klo rada2 gak nyambung. Sekilas lihat program Nutritious Rice for the World. Nah bagaimana kira2 plus minusnya, klo sbg pengguna pc yg terkoneksi k internet (warnet or rumahan), kita ingin ikut berpartisipasi dlm proyek gotong royong itu.
    .
    Mohon pencerahannya.
    .
    Terimakasih.

  • 12
    sufehmi
    June 18th, 2008 15:31

    @Zam - saya coba baca-baca disini, menarik juga ya.
    .
    Ruginya saya kira nyaris tidak ada, paling penggunaan listrik di komputer sedikit meningkat. Untungnya adalah kita turut membantu proyek yang tujuannya mulia ini.
    .
    Ternyata softwarenya ada versi Linux nya ya. OK saya sedang download nih.
    Terimakasih untuk infonya :)

  • 13
    Shugoshin
    August 31st, 2008 21:45

    Wah, gak ngerti programing, bkn bidang saya.

  • 14
    Azil
    September 1st, 2008 10:07

    ehem…

    Ya, saya tidak punya account Friendster / Facebook / Orkut / dst. So sue me

    *lirik invitation facebook*

  • 15
    sufehmi
    September 1st, 2008 10:26

    @Azil - euh, blame belutz :D

Leave a Reply

Subscribe without commenting