experience lessons from architecture of zalo real time system

21
Zalo Real-time System: Architecture & Experience By Nguyen Quang Nam Zing Senior Software Manager Web-Technical

Upload: zaloapp

Post on 25-Jan-2015

1.686 views

Category:

Technology


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Experience lessons from architecture of zalo real time system

Zalo Real-time System: Architecture

& ExperienceBy Nguyen Quang Nam

Zing Senior Software Manager

Web-Technical

Page 2: Experience lessons from architecture of zalo real time system

Content

• About Zalo• Technology in Zalo• Real-time System Architecture• Experience• Q&A

Page 3: Experience lessons from architecture of zalo real time system

About Zalo

Page 4: Experience lessons from architecture of zalo real time system

Features

• Communication: message (voice, text), call• Social: “Nhật ký”, “Phòng trò chuyện”

Page 5: Experience lessons from architecture of zalo real time system

Communication

Page 6: Experience lessons from architecture of zalo real time system

Social

Page 7: Experience lessons from architecture of zalo real time system

Updated stat

• Users: 3.0M total• Messages: 30M per day

Page 8: Experience lessons from architecture of zalo real time system

Technology in Zalo

Page 9: Experience lessons from architecture of zalo real time system

Technology

• Programming languages: C/C++ and Java for services at server-side• Client platforms: IOS, Android, Symbian (S40, S60),

Windows Phone (soon)

Page 10: Experience lessons from architecture of zalo real time system

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

Page 11: Experience lessons from architecture of zalo real time system

Real-time System Architecture

Page 12: Experience lessons from architecture of zalo real time system

N-Tier

Page 13: Experience lessons from architecture of zalo real time system

ZaCommServer

Page 14: Experience lessons from architecture of zalo real time system

ZaCommServer (cont)

• Programming language: C/C• IO event mechanism: Epoll (libevent)• Binary protocol with authenticated connections &

encrypted messages

Page 15: Experience lessons from architecture of zalo real time system

ZaCommServer (cont)

• Capacity per one box:• 1M concurrent connections tested• 200K throughput messages per second

Page 16: Experience lessons from architecture of zalo real time system

Experience

Page 17: Experience lessons from architecture of zalo real time system

Break the thing into multi-layers andlet they be independent each other

Page 18: Experience lessons from architecture of zalo real time system

Move biz out of high performance services

Page 19: Experience lessons from architecture of zalo real time system

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

Page 20: Experience lessons from architecture of zalo real time system

Q&A

Contact: Nguyen Quang Nam [email protected]

http://me.zing.vn/nam.nq

Page 21: Experience lessons from architecture of zalo real time system