# Pull vs push architecture for Mobile

DevFeed: [Pull vs push architecture for Mobile](<https://devfeed.tech/articles/pull-vs-push-architecture-for-mobile-22782.md>)

Original publisher: [Read original article](<https://medium.com/microsoft-mobile-engineering/pull-vs-push-architecture-for-mobile-6956d37c5869?source=rss----87f10537e947---4>)

Author: Abhishek Kharb

Published: 2023-10-10T13:33:07Z

Content type: tutorial

Language: en

Sources: [Android@Microsoft - Medium](<https://devfeed.tech/sources/android-microsoft-medium.md>)

Topics: [Mobile](<https://devfeed.tech/topics/mobile.md>), [API](<https://devfeed.tech/topics/api.md>), [data](<https://devfeed.tech/topics/data.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [client](<https://devfeed.tech/topics/client.md>), [servers](<https://devfeed.tech/topics/servers.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [api](<https://devfeed.tech/tags/api.md>), [communication](<https://devfeed.tech/tags/communication.md>), [data](<https://devfeed.tech/tags/data.md>), [http](<https://devfeed.tech/tags/http.md>), [ios](<https://devfeed.tech/tags/ios.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-app-development](<https://devfeed.tech/tags/mobile-app-development.md>), [push-notification](<https://devfeed.tech/tags/push-notification.md>), [request](<https://devfeed.tech/tags/request.md>), [server](<https://devfeed.tech/tags/server.md>), [servers](<https://devfeed.tech/tags/servers.md>)

## AI overview

This article explains pull- and push-based architectures for keeping mobile application data synchronized with servers. It describes user-triggered requests, short polling, long polling, and server-initiated updates through socket connections or platform push frameworks.

## Source excerpt

What is pull vs push architecture for Mobile? Almost all mobile applications need to regularly sync data from servers to be able to show their users fresh information for consumption. Photo by Claudio Schwarz on Unsplash This data sync can be achieved in broadly two ways: 1. Pull based model -- The pull-based model requires apps to initiate an API call in order to fetch the latest data. This call is usually initiated by some user action defined by the programmer. It could be when a user navigates to a particular screen in the app or performs a particular action (like pull to refresh), or it could be based on the polling technique. Broadly, polling can be achieved in one of the two following ways: Short polling: Sometimes referred to as Regular polling or Standard polling, in this case the client makes an HTTP call to the server at regular intervals of time. As and when the data is available, the server returns the data back to the client, until then the server just sends the same old data or empty response depending upon the implementation. One of the major drawbacks of this technique is that since the data is refreshed at regular intervals by the client, it results in redundant calls when no new data is available and stale data if something changes on the server before the next call is made. Short polling-based mechanism for data sync. Long Polling: This technique aims to address the redundant calls made by the client in short polling that return no new data from the server. In this case, the client makes an HTTP call to the server, but the server doesn't immediately respond if there is no new data available. Instead, the server waits until new data is available (or until the request times out), after which the server responds with the data. As soon as the client receives data from the server (or after the request times out), it sends another request (or after a certain cool off period), and the same process is repeated. Long-polling based mechanism for data sync. 2