How Feishu Counts Group Read Receipts: Store Watermarks, Not Read Arrays
The answer to high-frequency read state is a message broker's offset model: keep immutable messages untouched and make each user's progress an O(1) update. Chat, collaboration, and shared-state systems can reuse this split to avoid lock storms and connection-pool exhaustion that a naive read_by array creates.
Group chat read receipts look trivial: add a read_by array to each message and push a user ID when someone reads it. In a 500-person group that design collapses. Every read triggers a concurrent append to the same message record, and the row becomes a lock-contention hotspot. Paging through history forces the server to package read state for hundreds of messages while other members keep writing, so row locks queue up and the whole read path slows down.
Feishu's solution separates message content from read progress. Each message gets a strictly increasing int64 sequence number, and each group member keeps a last_read_seq watermark in Redis Cluster, keyed by group_id + user_id. A single message copy stays in the storage cluster; watermarks advance independently using HINCRBY and HSET. That is exactly RocketMQ's architecture: all messages go to one Commit Log, and every consumer group tracks its own offset in a separate Consumer Queue index. A chat window maps to a topic, the sender to a producer, and the 500 group members to consumers in a single consumer group.
Three implementation details matter. Watermarks live outside the message store. Scaling rides on RocketMQ's MQClientFactory, which builds producer and consumer from the same long connections, so IM commands can extend that channel. Pushing read status back to the sender uses the existing client-gateway long connection, the same bidirectional Netty link RocketMQ uses for transaction message callbacks. The net effect of last_read_seq is reducing O(N) updates per message to O(1) per member, and the real skill is recognizing that this 'new' feature is a solved message-queue pattern.
The central claim is that group chat read receipts are a known message-queue consumption pattern, and the mappings to topic, producer, and consumer group are exact, so the solution is recognition rather than invention.
Multiplying a single-chat read pattern by 500 turns modest write traffic into a lock-contention and connection-pool bottleneck; the fix is a data layout change, not a performance tweak.
RocketMQ's bidirectional Netty connection, which the broker uses for transaction-message callbacks, is the same channel that can push read events from an IM gateway back to the sender.