Mobile Sync Service (MSS) is a core basic business component of the mPaaS platform. MSS originates from the E2E solution SYNC of Ant Financial Group, which is oriented to mobile Apps and pushes massive data from the server to the client. This component provides a secure data channel based on the Transmission Control Protocol (TCP) and Secure Sockets Layer (SSL). This data channel can actively synchronize business data from the server to the client App on a timely, accurate, and orderly manner.
Traditional RPC has been applied in the Internet industry for decades and can meet most business scenarios and functional requirements. However, the popularization and development of the mobile Internet have driven the App scale and users' requirements for Apps to a new stage. Traditional RPC requests have many drawbacks due to their own characteristics.
The client must call an RPC request to retrieve the latest data in certain scenarios, even when little or no data has changed on the server-side (the cloud).
When the client starts, different business modules and features must make separate RPC requests to pull their own data because they are designed independently.
The client cannot immediately detect data changes on the server-side. It can only refresh data by periodically polling the RPC interface.
Most traditional RPCs use short-lived connections over HTTP(S) for data exchange. Even with features such as keep-alive, the connection cannot be maintained for a long time, which prevents continuous link reuse. Creating connections, exchanging certificates, and performing encryption and decryption consume significant network time and resources.
MSS is introduced to address these problems.

Features
MSS has the following features:
Reliable synchronization
For business scenarios that require a guaranteed delivery Quality of Service (QoS), MSS ensures that the client synchronizes the pushed data. This occurs as long as the user is active within the data's validity period and meets the push conditions, such as the client version number and operating system type.
Incremental and ordered delivery
MSS guarantees that messages arriving at the client within the same channel are in the same order they were sent by the business server. All messages are synchronized to the client incrementally.
High real-time performance
When the client has a good network connection, MSS ensures high real-time push performance. Message push latency is almost entirely dependent on network transmission time, with messages typically delivered within 1 second.
Basic principles
Similar to the binlog mechanism in MySQL, the basic unit of data transferred between the MSS server and the client SDK is an oplog. When a business needs to sync a data change to a specific user or device, it calls the MSS interface. The MSS server-side then wraps the data change into an oplog, persists it to the database, and pushes the oplog to the client when it is online. Each oplog has a unique oplog ID. The oplog ID is guaranteed to be unique and to increase monotonically based on the call order for a specific user and business. The MSS server-side pushes each oplog to the client in ascending order of the oplog ID. Both the MSS server-side and the client record the highest oplog ID that the client has received. This record is called a sync point, which can also be considered a data version number.

Benefits
Merged push
When the client initializes successfully, the server-side can push data for multiple businesses at once. This reduces the number of requests from different businesses.
Incremental push
Business data is pushed only when there is incremental data. This effectively reduces redundant data transfer and lowers network costs.
Fewer requests
When there is no incremental data, no request costs are incurred. This reduces redundant business requests.
Improved timeliness
When data changes on the server-side, the changed data can be pushed directly to the client with minimal delay, without waiting for a client request.
Better user experience
Data is pushed seamlessly. The data is already available before the client interface is rendered, which reduces user wait time.
Applicable scenarios
MSS can be used in business scenarios that require real-time data pushes to a client, such as pushing transfer results, payment results, and Message Center notifications. The following scenarios illustrate the capabilities of MSS.
In an instant messaging app, MSS provides reliable, incremental message delivery. It pushes chat messages to specified users in the order they were sent.
In an app that requires dynamic configuration updates, MSS can dynamically push configuration information to all devices. It pushes information such as app feature toggles, dynamic parameters, and dynamic configurations to specified clients in real-time. It can also dynamically change business parameters and configurations in batches while the app is running.
In a payment app, MSS provides a secure tunnel for pushing online transaction data. This ensures that the app can receive pushed data in real-time when it is online. MSS also provides data persistence. This allows the app to receive data that was pushed while it was offline the next time it comes online.