Paresh GoelAll things Android, Hike Messenger
Building for India.
Gearing for 100 Million users
2
LAUNCH: DEC’2012
AUG’14: 35M USERS IN 20 MONTHS
INDIA: 90% OF USERBASE
3
Days
WHERE WE ARE
0.
12.5
25.
37.5
50.
62.5
0 50 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 950 1000 1050 1100 1150 1200 1250 1300 1350 1400 1450 1500
Hike Twitter Facebook
4
Days
0.
12.5
25.
37.5
50.
62.5
0 150 300 450 600 750 900 1050 1200 1350 1500Hike Twitter Facebook
WHERE WE ARE
BIGGEST INDIAN MOBILE
APP
10 BILLION+ MESSAGES
PER MONTH
What does Building for India mean?
What does Building for India mean, Technically ?
• Network optimisation.
• Catering to low-end devices.
Network optimisations
• Most people in India use sachet data packs.
• It costs INR 3 / MB.
Client-Server Protocol
• Has to be persistent.
• Takes care of flaky network condition.
• Consumes lesser bandwidth.
MQTT (Message Queue
Telemetry Transport)
• Network protocol for broadcasting and
listening for information over network.
• Lightweight: Header to Message ratio is less.
• Publish / Subscribe mechanism.
• Support for QoS Levels.
MQTT Message Format
• A MQTT topology has a MQTT server and a
MQTT client.
• The protocol works by exchanging a series of
MQTT Control Packets.
MQTT Control Packet
Structure
Client Server
CONNECT
CONACK
SUBSCRIBE
SUBACK
PUBLISH
PUBACK
DISCONNECT
Client Server
CONNECT
CONACK
SUBSCRIBE
SUBACK
PUBLISH
PUBACK
DISCONNECT
Client Server
CONNECT
CONACK
PUBLISH
PUBACK
DISCONNECT
Auto-subscribe
QoS Levels
• At most once. QoS=0
• At least once. QoS=1
• Exactly once. QoS=2
Active and Passive timeouts.
• GCM Push for passive state.
• Aggressive timeouts for active state.
File Transfer
Optimisations.
3 BILLION+ STICKERSPER MONTH
LOCALIZED STICKERSINDIA
Avoid transfer when you can.
Don’t load images on scroll.
Client Server
MD5
Key
Publish with key
MD5 checksum
Client 1 Server Client 2
Publish with Sticker Id
Publish with Sticker Id
use local file path
Use Unique Id
Client 1 Server Client 2
Publish with Sticker Id
Publish with Sticker Id
Request File for Sticker Id
File for Sticker IdAdd Entry
Transfer based on destination dpi.
Chunk sizes to cater to a flaky network connectivity.
Multi-threaded download.
Still playing: Chunk size could vary on actual speed at runtime.
Feature Optimisations
App decisions are also based on minimising
bandwidth consumption.
In India, users may be offline for long periods of
time.
We send pending messages in one bulk packet.
This reduces headers and corresponding Ack
packets.
Bulk Packet
Last Seen
We moved into a subscription rather than a
broadcast mechanism.
Summary
• Network Optimisations should be top priority
• Choose bandwidth-optimised network
protocol.
• File Transfer - MD5, resolution based.
• Feature decisions - optimise for network.
38
THANK YOUGO BIG OR GO HOME
PARESH GOEL,HIKE MESSENGER
paresh@hike.in
hikeathon@hike.in
19-21 Dec
Your code is worth a Million !