• Campaign promotion • Release information of a new product • Send a coupon • And so on Broadcasting > Most widely used feature of LINE Official Account
Renewal Needed > We started to provide new pricing plan as part of “Redesign” project • For user: Get more valuable information • For businesses: Reach appropriate users > Needed to update message insights • Update timing: daily => realtime • Verbosity: only basic metrics => more detailed metrics
> These metrics are updated in realtime > Detailed User Interaction Metrics • Number of people who viewed the message (unique impression) • Number of people who clicked the link in the message (unique click) • Total impression count of the message • And so on Message Insights Renewal
> ✅ User reactions for broadcasted messages from LINE Official Account Target Events of Message Insights > ❌ User reactions for ordinary (≠ LINE Official Account) LINE messaging • e.g. ordinary “Mark as Read”
> Update metrics in realtime > Maintain both of realtime-ness and persistency > Track events without impacting UX Challenges > Large traffic of message events
> Possible architecture • 1. Embedding metadata in message itself, then send back when track an user reaction event • 2. Separate metadata from message itself. Streaming join later Send Messages > Message metadata contains information necessary for aggregation
> Why ? • To minimize network usage so that never affecting UX Send Messages > We adopt 2. Separate metadata from message itself > Cons • The architecture becomes complicated a bit
Track Events > Event Tracking SDK collects detailed user events • Impression of balloon 1,2,… • Click of url X in balloon 1,… • And so on Balloon 1 Balloon 2 Balloon 3 1 Broadcast
Counting Unique User > “Count-Distinct” problem > Generally, calculating count-distinct requires O(N) space > The space may not fit on memory for massive dataset
HyperLogLog > A probabilistic algorithm solving “Count-Distinct” problem > Redis provides HyperLogLog via PFxxx command family • PFADD: Add an element to HyperLogLog data structure • PFCOUNT: Estimate distinct count • PFMERGE: Merge two HyperLogLog data structures into one
Gather Realtime Data and Batch Data 2019-11-15 (Message Sent Date) 2019-11-16 2019-11-17 2019-11-18 2019-11-19 (Last Batch Date) HBase Redis Cluster 2019-11-20 (Realtime) Sum Up