Unit 12
Unit 12
12.0 INTRODUCTION
Mobile devices are used for various use cases in our daily lives. We use mobile devices
to chat with our friends, to take pictures, to send and receive emails, play games, navigate
through maps, to attend online meetings and such. Modern day smart phones provide
machine learning (ML) and artificial intelligence (AI) enabled features such as vison,
image recognition, augmented reality and many other features. Customers, enterprises,
businesses all use mobile apps to deliver information, services and to share resources.
The mobile device accesses the services over the Internet and uses enterprise
applications, cloud databases and other services. To provide constant connectivity and
data access mobile device has to be in constant touch with the access points.
In this chapter we discuss the mobile data management, data replication and adaptive
clustering related to mobile device.
12.1 OBJECTIVES
After going through this unit, you should be able to
understand key concepts of mobile data management,
understand data replication schemes,
understand key concepts of adaptive clustering
Mobile devices manage the data required for its services and apps locally as well on
remote secure cloud databases. The mobile data includes the contact list, photos, media
files, conversations, documents, game data and such. Mobile device stores these files in
local database and also regularly synchronizes the files with the remote database.
1
Mobility, Portability, A mobile app might use the data that is distributed across various databases. For instance,
Replication and a gaming mobile app might use the authentication service from the enterprise’s active
Clustering
directory and it might use the cloud database to persist the game details (such as game
levels, game points for a given user). Hence the mobile device has to process the queries
for distributed databases. We have depicted a mobile computing system in Figure 1 that
uses distributed services and database across cloud platform and corporate data center
and business services.
Figure 1 Mobile computing system that uses services distributed across cloud and data
centre.
In Figure 1, the mobile app is connected over secured network to the cloud platform,
corporate data center and business application that is exposed as software as service
platform.
The mobile app provides shopping experience to the end user and connects to AWS
(Amazon Web Service) cloud platform for backend processing. To start with, the
shopping mobile app authenticates the user against the active directory hosted in the
corporate data center. Once the user is successfully authenticated, the product details and
user search results are fetched from the backend severs hosted in the AWS. The product
list and product search APIs are hosted in the AWS API Gateway that internally uses the
Lambda functions and backend servers to get the required information. The backend
servers and the Lambda function retrieves the information from the AWS RDS database
service. The mobile app users use the email service hosted as software as service
platform. In this example, the shopping mobile app has to query against three separate
systems and process the information retrieved from these systems.
Mobile app has to manage the data from various sources in its local database. We have
given the popular mobile databases below –
SQLite is one of the most popular mobile databases as it can efficiently store and
process different formats of data. SQLite can run in the mobile devices as it uses
minimal resources.
AWS DynamoDB is one of the most popular NoSQL databases that can efficiently
store the key-value pair data. Mobile apps use AWS DynamoDB to store the session
data, shopping cart data and other key-value data pair.
MongoDB is a popular opensource database for storing and efficiently managing the
documents.
2
Mobile Computing
Redis is a popular caching platform that can manage the frequently used data for use
cases such as leaderboards, gaming applications.
Neo4J is a popular graph database that can efficiently query the relationship between
data.
Data Synchronization
The data has to be stored be stored in the local database as well on the remote database.
We need to design the efficient data synchronization process to synchronize the local
data with the remote database on the cloud.
Transaction Management
As the mobile apps work with distributed databases, maintaining the data integrity, ACID
(atomicity, consistency, integrity and durability), strict consistency and the correlation of
data across all the databases becomes a challenge.
Data processing
The mobile apps need to identify what data that needs to be processed on the client side
and what data has to be processed on the server side. The data that needs heavy duty
processing has to be done at the remote server end to ensure high performance.
Network Connectivity
Due to the dynamic nature of the mobile network, the mobile apps need to handle the
data management in unpredictable network conditions. One of the popular approaches is
to use offline-first approach wherein the data is stored locally during low network
scenarios and it will be synchronized with the remote database when the network
stabilizes.
Data Security
The data at rest and data in transit has to be secured through encryption, transport level
security and other mechanisms.
Mobile apps need to handle the queries that are location dependent and need to manage
other dependencies.
Resource management
As the mobile device has limited compute, storage and battery capacity, the mobile app
has to manage the data within these constraints.
Given below are the main factors of wireless communication that impacts mobility –
The network bandwidth and the signal strength based on the location.
As mobile devices are resource constrained, the mobile devices need to manage the large
amount of data generated by the mobile apps that require large storage and heavy-duty
data processing.
Data portability involves replicating or moving the data across different servers,
environments and across different operating systems.
Given below are the core best practices for handling mobile portability –
Store the frequently used data in local data store (such as in SQLIte database) and
synchronize the data from local data store to cloud database on frequent basis.
Backup the local data to remote servers on regular basis (such as for photos, videos
and media files)
Centrally store the core data (such as contact list, browser bookmarks, chat
conversations) for security reasons.
Use an open-standard data format to provide flexible and extensible data replication
(such as using JSON or XML file formats).
Adopt offline-first approach to manage data locally when there are no networks.
5
Mobility, Portability, Data replication is a mechanism wherein the data on the mobile device is replicated to
Replication and another computer or device or remote cloud server. If the copied data changes in the
Clustering
target (such as remote cloud server), the updated data is replicated back to the mobile
device. In summary the changed data is synchronized across all the devices.
In a one-to-many replication scheme, the user copies the data to the centralized server
which then replicates the data to various mobile devices as depicted in Figure 3. An
example of one-to-many data replication is the security policy replication between an
organizational server and all the manged mobile devices belonging to its employees.
6
Mobile Computing
Data synchronization task - We need to design the data synchronization job that
handles the incremental data replication across devices. The data synchronizer task
has to synchronize the data at specified time intervals.
Data merging and conflict resolution – During many to many data synchronization as
the data from multiple device needs to be synchronized, the synchronizer has to
handle the conflict resolution (when the same object has been updated
simultaneously by two different devices) and data merging (merging the changes). 7
Mobility, Portability,
Replication and Data security – The data replication job should also ensure that data is securely
Clustering
copied to the target locations.
Handling data schema changes – Different domains have different data schemas and
as such the data replication job has to ensure that a common schema based on open
standards (such as JSON or XML) is used for data replication.
Handling data conversion – Due to the heterogenous nature of the devices, the data
may need to be converted during the data replication process.
In full replication the entire data is replicated across devices. For instance, the mobile
device copies all the images from the device to the cloud drive. In the partial replication,
only the limited set of data to the target device. For instance, the mobile device replicates
only the data updated on the day to the central server on daily basis.
In traditional client-server kind of scenario, the server pushes the data on a frequent basis.
The client device caches the pushed data in its local data store and uses the data for its
mobile apps. The client mobile device regularly pulls the updated data from the server.
An example for this model is a gaming mobile app wherein the game mobile app running
on the local device gets the complete set of game rules during the one-time setup. Post
the mobile game app installation, the app regularly pulls the updated game rules from the
centralized rules database on daily basis. This method is also known as “one-to-many”
communication wherein a single server pushes the data and many clients pull the data.
The second model of synchronization is that a single device will pull and push the
information as in the case of peer-to-peer communication. An example for this model is a
peer-to-peer sharing mobile app that shares the data and files to another mobile device.
In order to conserve the consumed energy, the mobile devices communicate with its
nearest neighbors instead of transmitting the signal to all the mobile devices. By
localizing the communication, we can optimize the latency and conserve the energy.
Cluster formation
Various factors such as the mobile device’s signal strength, distance, communication
protocols, network load are used along with clustering algorithms (such as distance based
clustering, traffic load based clustering, mobility based clustering) to create the clusters.
Device communication
Post cluster creation, the mobile devices in a given cluster communicate directly. To
communicate with other clusters the mobile devices use cluster heads that act as gateway
to across the clusters.
Cluster reconfiguration
The cluster is re-adjusted dynamically based on the changing conditions. For instance, if
the mobile device moves out of the location range, the mobile device is removed from the
cluster and added to a new cluster to ensure optimal performance and optimal energy
consumption.
1. In _____ replication method, the data from the server or PC and gets replicated
to the mobile device.
2. In ______replication method, the data from a centralized server replicates the
data to various mobile devices.
3. In _____ replication method bi-directional replication happens across various
devices.
4. In __________replication, the data is replicated continuously in real time.
5. _______ clustering is a dynamic grouping of mobile devices to improve
performance and optimize the energy consumption.
9
Mobility, Portability,
Replication and 12.5 SUMMARY
Clustering
In this chapter we discussed various concepts related to data handling schemes of mobile
devices. Mobile devices use data distributed across various datastores. Mobile app uses
various database such as SQLite (for managing data locally), MongoDB (for document
management), Redis (for caching), DynamoDB (as NoSQL database for key-value pair),
Neo4J (for graph use cases). The main challenges in mobile data management are Data
synchronization , Transaction management ,Data processing, Network connectivity, Data
security, Managing location dependency and Resource management. Varying
bandwidth, varying power consumption, handling transactions, handling data backup
jobs are the key Challenges and issues during mobility. The core best practices for
handling mobile portability are local data caching, data encryption, data backup, open
standards, caching. The three kinds of data replication methods are one-one, one-to-many
and many-to-many. Adaptive clustering is a dynamic grouping of mobile devices to
improve performance and optimize the energy consumption.
12.6 SOLUTIONS/ANSWERS
Check Your Progress 1
1. mongodb.
2. Neo4j.
3. Redis .
4. Data synchronization
Check Your Progress 2
1. One-to-one.
2. One-to-many
3. Many-to-many
4. synchronous
5. adaptive
https://en.wikipedia.org/wiki/Network_virtualization
https://en.wikipedia.org/wiki/Cloud_computing
10