7 Mobile Data Management

Mobile Application Development ยท Unit 7

Mobile Data Management

Exam-focused notes for Mobile Data Management (Mobile Application Development, BIT406): what the TU syllabus asks and how it has actually been tested, with 1 solved past questions from this unit.

Mobile Data Management in short

Mobile apps often work with data that lives both on the phone and on a server. The topic explains how copies are kept consistent, how data is stored on the device, and how apps keep working without a network.

Mobile Data Management: notes

Data synchronization in mobile applications

Data synchronization means keeping the copy of data on the device and the copy on the server the same. A user can change data on the phone, on the web or on another device, and all should end up with the same result.

Types:

  • One-way sync: data flows in one direction only, such as a backup or a news download.
  • Two-way sync: changes go both ways, such as contacts or notes.
  • Full sync: all data is copied each time. It is simple but slow.
  • Incremental sync: only changes since the last sync are sent. It saves bandwidth and battery.

Common ways to start a sync: the user pulls to refresh, a timer, or a push message from the server.

Typical process:

  1. The device sends the changes made since the last sync, along with a version or time stamp.
  2. The server applies them and sends back its own changes.
  3. The device updates its local store and records the new sync point.

Conflicts happen when the same item is changed in two places. Ways to resolve them:

  • Last write wins.
  • Server wins.
  • Merge field by field.
  • Ask the user.

On Android, WorkManager is used to schedule reliable background sync, even if the app is closed.

What this unit covers

  • Data synchronization in mobile applications
  • Data replication strategies
  • Mobile data storage considerations
  • Offline data handling

Data synchronization in mobile applications

2081 ยท 5 marks

Explain the synchronization and replication of mobile data. [5]

Show solved answer

Model Answer: Synchronization and Replication of Mobile Data

Definition and Context

Data synchronization in mobile systems refers to the process of keeping data consistent across multiple copies stored on different devices (mobile device, server, other clients). Data replication is the technique of maintaining multiple copies of data across distributed locations to ensure availability and reliability.

Key Aspects of Mobile Data Synchronization

1. Purpose of Synchronization

  • Ensures consistency between mobile device local storage and remote server
  • Maintains data integrity when users work offline
  • Resolves conflicts when the same data is modified on multiple devices
  • Enables seamless transition between online and offline modes

2. Synchronization Mechanisms

Pull-based Synchronization:

  • Mobile device requests updates from server
  • Device checks for changes at intervals
  • Reduces server load but may have latency

Push-based Synchronization:

  • Server notifies mobile device of updates
  • More immediate but requires persistent connection
  • Higher resource consumption

Bi-directional Synchronization:

  • Changes flow both from device to server and server to device
  • Most common in modern mobile applications

3. Data Replication Strategy

  • Master-Slave Model: Server holds authoritative copy; mobile devices hold replicas
  • Eventual Consistency: Replicas become consistent over time rather than immediately
  • Partial Replication: Only relevant/frequently-used data replicated locally on mobile device

4. Conflict Resolution

When same data modified on multiple devices:

  • Last-write-wins: Most recent change overwrites others
  • Version vectors/timestamps: Track modification history
  • User intervention: Prompt user to choose correct version

5. Challenges

  • Limited bandwidth and intermittent connectivity
  • Battery constraints during sync operations
  • Storage limitations on mobile devices
  • Network latency and failures

In summary: Mobile data synchronization and replication maintain data consistency across distributed devices through coordinated update mechanisms, while handling offline scenarios and resolving conflicts that arise in disconnected environments.

Open this answer on its own page โ†’