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 :
- LinkedIn - A Professional Social Network Built with Java™ Technologies and Agile Practices
- LinkedIn Communication Architecture
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 !
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 !

