Experience lessons from architecture of zalo real time system

3,655 views

Published on

Published in: Technology, Business

Experience lessons from architecture of zalo real time system

  1. 1. Zalo Real-time System: Architecture & Experience By Nguyen Quang Nam Zing Senior Software Manager Web-Technical
  2. 2. Content • About Zalo • Technology in Zalo • Real-time System Architecture • Experience • Q&A
  3. 3. About Zalo
  4. 4. Features • Communication: message (voice, text), call • Social: “Nhật ký”, “Phòng trò chuyện”
  5. 5. Communication
  6. 6. Social
  7. 7. Updated stat • Users: 3.0M total • Messages: 30M per day
  8. 8. Technology in Zalo
  9. 9. Technology • Programming languages: C/C++ and Java for services at server-side • Client platforms: IOS, Android, Symbian (S40, S60), Windows Phone (soon)
  10. 10. Technology (cont) Connection servers are key points of the Zalo real-time system Free / Opensource Inhouse Load balancing HA proxy ZaCacheProxy, ZaRouter Web servers Ngnix, Jetty ZaHttp Searching Elastic, Solr Prefix Search Service Database PostgreSQL, MySQL ZaDB, List32, List64, … Connection servers ZaCommServer, ZEventbus
  11. 11. Real-time System Architecture
  12. 12. N-Tier
  13. 13. ZaCommServer
  14. 14. ZaCommServer (cont) • Programming language: C/C • IO event mechanism: Epoll (libevent) • Binary protocol with authenticated connections & encrypted messages
  15. 15. ZaCommServer (cont) • Capacity per one box: • 1M concurrent connections tested • 200K throughput messages per second
  16. 16. Experience
  17. 17. Break the thing into multi-layers and let they be independent each other
  18. 18. Move biz out of high performance services
  19. 19. Lessons Zalo learned • Http long polling is not a good choice for a good app • Do not spend much time in optimizing small data • Memory fragment is a really big trouble in high performance services, develop our own memory allocator lib instead of using default system glibc
  20. 20. Q&A Contact: Nguyen Quang Nam namnq@vng.com.vn http://me.zing.vn/nam.nq

×