Backend Development 10 min read

Building Real-time Data Push Service for Mini Program Cloud Development: An Interview with Tencent Senior Engineer

In an interview, Tencent senior engineer Zhou Zijie explains how the new real‑time data push service for Mini Program Cloud Development monitors cloud‑database changes and reliably streams updates to mini‑apps via a three‑layer SDK‑middleware‑backend architecture that uses sequential numbering, TARS RPC, and extensive optimizations to achieve low latency, high concurrency, and will launch publicly in August.

Tencent Cloud Developer
Tencent Cloud Developer
Tencent Cloud Developer
Building Real-time Data Push Service for Mini Program Cloud Development: An Interview with Tencent Senior Engineer

This is an interview with Zhou Zijie, a senior R&D engineer at Tencent, discussing the real-time data push service for Mini Program Cloud Development (小程序云开发). The service enables monitoring of cloud database changes and pushing real-time updates to mini programs, eliminating the need for developers to build their own WebSocket infrastructure.

Background and Requirements: The project addresses two main needs: enhancing the existing cloud database functionality with better封装, and fulfilling user requests for real-time messaging capabilities (e.g., live streaming bullet comments). Users wanted WebSocket functionality to push messages directly from backend to frontend without building their own services.

Comparison with Tencent Docs: While both systems require real-time data capabilities, they differ in focus. Tencent Docs prioritizes data reliability since any content error invalidates subsequent edits, with lower latency and concurrency requirements. The real-time push service must excel in data reliability, low latency, and high concurrency since it serves multiple applications simultaneously.

Architecture: The system consists of three modules: 1) Mini Program frontend SDK (handles reliability logic), 2) Middleware (maintains WebSocket connections with frontend, polls backend for new events), and 3) Backend (traditional service that returns latest messages). The design follows a "mutual distrust" principle with redundancy across modules to ensure data reliability.

Data Loss Detection: The system uses sequential numbering for pushed events. When the frontend detects a gap in sequence numbers (e.g., receiving event #5 after #1 and #2), it recognizes data loss and requests retransmission of missing data.

Performance Optimizations: To achieve low latency, all backend services use TARS framework-based RPC communication. For high concurrency, the middleware layer is continuously optimized to support more concurrent connections. Initial tests showed 8-core machines supporting only a few thousand connections, but after optimizations, the system achieves significantly higher concurrency and availability.

Cloud Database vs Traditional Databases: Cloud Development's database is a service that bridges backend and frontend, allowing frontend developers to perform CRUD operations with minimal code without worrying about backend implementation details. This significantly reduces communication and development costs.

Future Plans: The core functionality is complete and undergoing internal testing with several Tencent mini programs. The service will officially launch in late August. Future optimizations include further streamlining the middleware layer by moving more business logic to the backend, allowing each machine to support more long-lived connections.

serverlessbackend architecturehigh concurrencyWebSocketTencent CloudReal-time Data PushMini Program Cloud Development
Tencent Cloud Developer
Written by

Tencent Cloud Developer

Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.