Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Real time syncing

I want to develop application same as UBER in which I need to show available taxis in the selected region and update as the taxis are hired, available, unavailable. Kind of auto refresh. Calling the web service in the background after regular time interval is not a good option. Can any one suggest me better and fast way to achieve this.

Thanks

like image 556
NiKKi Avatar asked Nov 17 '15 09:11

NiKKi


People also ask

What is real time syncing?

Real-time synchronization is the capability to quickly update the latest changes by a central system, often from multiple channels.

Is FreeFileSync really free?

FreeFileSync is a free and open-source program used for file synchronization. It is available on Windows, Linux and macOS. The project is backed by donations.


1 Answers

Push

  • Use sockets when the app is running. This will give you immediate updates.
  • Use Push notifications when the app is not running (use notifications for critical changes), and ignore these notifications when the app is already running, in favor of sockets.

Pull

  • Use NSURLSession to refresh your local DB with some regularity. This is very resilient to network failure.

Use a combination of approaches, since speed and robustness are mutually exclusive. Ultimately, your objective is to keep your local DB in sync with your server's DB, and fire internal messages as data changes. No small task, hence the Firebase answer.

like image 86
SwiftArchitect Avatar answered Oct 22 '22 22:10

SwiftArchitect