Professional Documents
Culture Documents
Unit 5 Notes 2014 PDF
Unit 5 Notes 2014 PDF
The Second Tier is Process Management or Application Tier. This layer is for application
programs or process management where business logic and rule are executed. This layer is
capable of accommodating hundreds of users. In addition , the middle process management
tier controls transactions and asynchronous queuing to ensure reliable completion of
transactions.
The Third Tier is Database Management or Data Tier which is for database access and
management.
In case of Mobile Computing the system will be used through any network, any bearer, any
agent and any device. The system should be connected to a ubiquitous network like
Internet.
Presentation Layer
Application Tier
This tier is independent of presentation and database Management. It is the engine of a
ubiquitous application. It performs the business logic of processing user input, obtaining
data and making decisions. It addition to business logic it handles additional management
functions (decision related to rendering, n/w management, security, data store access etc.).
These additional functions are handled using middleware. Middleware-layer of software is
the one which is sitting between OS and user interface of the software. There are many
types of Middleware- Message oriented Middleware, Transaction Processing Middleware,
communication Middleware, Distributed Objects and components, Transcoding
Middleware, Web Services etc.
This maps numerous client requests through application service routines to different
application tasks as show in the figure below.
Communication Middleware
This middleware is used to connect one application to another. This is quite useful in the
telecommunication world. It uses mediation server to automate the telnet protocol to
communicate to nodes in the network. Example- using telnet to connect one application to
another.
Transcoding Middleware
Used to transcode one format of data to another suiting the network of the client. This is
useful for content adaptation to fit the needs of device. For example if we want to access a
website using a mobile phone then the HTML page has to be transcoded to WML page
Example- Internet Content Adaptation Protocol (ICAP) from IETF.
Data Tier
This tier is used to store data needed by the application and acts as a repository for both
temporary and permanent data. It can use XML for interoperability of data with other
systems and data sources. This tier might incorporate the use of Database Middleware and
SyncML.
Database Middleware
It interfaces application programs and database. It allows the business logic to be
independent and transparent of the database technology and database vendor. These are
sometimes called database connectors eg. ODBC, JDBC, etc.
Many applications require the ability to download information from an information repository and
operate on this information even when out of range or disconnected. The need to manipulate larger
amounts of data, combined with the slow speeds—and often the unavailability—of current
wireless data networks leads many applications to require a local relational database on the
mobile device.
Communicate with centralized database server through modes such as wireless or Internet
access;
Replicate data on centralized database server and mobile device;
Synchronize data on centralized database server and mobile device;
Capture data from various sources such as Internet;
Manage/analyze data on the mobile device;
Create customized mobile applications.
Smart client applications have emerged as the architecture of choice over browser-based
wireless Internet applications, as they enable access to data while the mobile user is
disconnected from the network—wireless or otherwise.
This capability is best implemented by incorporating persistent data storage using a mobile
database in the application.
The main advantage of using a mobile database in the application is offline access to data.
The ability to read and update data without a network connection.
This helps avoid problems such as dropped connections, low bandwidth, and high latency
that are typical on wireless networks today.
Possible Applications
• Traffic control
• Taxi dispatch
• Emergencies services: police, medical, fire, …
• Car navigation
• Location-aware search and recommendation
• Social applications: information / opinion sharing and search among community
• …
Mobile database offerings from traditional database powerhouses
The traditional database powerhouses—IBM, Oracle, Sybase, and Microsoft—have all
developed mobile database products that work in conjunction with their enterprise database
products. Several popular mobile database products have emerged including Sybase SQL
Anywhere Studio 8.0, Oracle9i Lite, Microsoft SQL Server CE, and the PointBase RDBMS.
These products include support for a variety of programming languages, operating
environments and include synchronization support for replicating data to/from enterprise data
sources.
Mobile databases typically involve three parties: fixed hosts, mobile units, and base stations.
Fixed hosts perform the transaction and data management functions with the help of database
servers.
Mobile units are portable computers that move around a geographical region that includes the
cellular network (or "cells") that these units use to communicate to base stations. (Note that
these networks need not be cellular telephone networks.)
Base stations are two-way radios, installations in fixed locations, that pass communications
with the mobile units to and from the fixed hosts.
When a mobile unit leaves a cell serviced by a particular base station, that station transparently
transfers the responsibility for the mobile unit's transaction and data support to whichever
base station covers the mobile unit's new location.
i. Data management
Data caching
• Results of previous queries are cached on mobile clients
Cache size
Cache freshness/update frequency
Cache consistency
• Query log can be further used in personalization and recommendation
– User preference learning
• keywords, categories, location
– Collaborative filtering for content recommendation
Query Constraints
Query response time
o Realtime query
Search-result accuracy
o Distance, time, path, traffic flow, …
Throughput: number of queries per time unit
o Scalability: large number of simultaneous queries
Concurrency control
Similar to the issues of concurrency control in distributed systems
o Time synchronization
Timestamps, clocks
o Latency in mobile queries
o Similar issues to cache consistency
Size of query results
Replication Strategies
1. Synchronous Data Replication
Synchronous replication is a technique for replicating the data between databases where the system
being replicated waits for the data to have been recorded on the duplicate systems before proceeding.
Under synchronous data replication (SDR) strategy, updates are applied to all the database replicas of an
object as a part of the original transaction. The database replicas are then kept in a state of
synchronization at all the network nodes by updating all the replicas as a part of one atomic transaction.
That is, when one copy is updated, all other copies need to be updated as well.
Advantage:
Synchronous replication guarantees that all copies have the same data.
Disadvantage
In write-all approach if a transaction tries to write to all copies of replicated system and one copy is not
available, the transaction can’t commit.
This doesn’t provide availability and prevents replication from occurring.
Due to an increase in response time and communication delays, this scheme is often impractical unless
the secondary systems are close to the primary system
2. Asynchronous Data Replication (ASDR)
Asynchronous Replication is a technique for replicating data between databases where the system being
replicated does not wait for the recording of the data on other duplicate systems. With asynchronous
replication in a multi-master of peer-to-peer environment, an update is done in one database, and when
it is committed the transaction is propagated to other masters. This way it requires less networking and
hardware resources than synchronous replication. However, ASDR does not enforce consistency
between the replicated databases.
A conflict might occur, as for a period of time, data might be different in different master sites. The
delay in regaining consistency may range from a few seconds to several hours or even days.
Asynchronous replication has the advantage of speed at the risk of data loss during communication or
duplicate system failure. But this is the latest technology to provide fault tolerance for server and
network storage. Asynchronous replication technology works by capturing changes in files at the
operating system level whereas technique works at the application level.
3. Snapshot Replication
Snapshot replication is in all replication types as initial base copy of the database to subscribers. A
snapshot is a copy of a database in a single point of time. Entire snapshot is initially copied from the
distributor to subscribers by the distribution agent. From thereon, the data in the published tables is
refreshed periodically. This can be a long process as database snapshots can be large in size and can take
lot of resources. Therefore careful planning and scheduling is required. Generally, snapshot replication is
used mostly in read-only data distribution setting, where data is updated infrequently. It is the simplest
replication type SQL Server offers.
Design Rationale
CODA major objectives were
o Using off-the-shelf hardware
o Preserving transparency
Other considerations included
o Need for scalability
o Advent of portable workstations (mobile devices)
o Balance between availability and consistency
Coda has many features that are desirable for network file systems, and several features not found
elsewhere
Disconnected operation for mobile computing.
Is freely available under a liberal license
High performance through client side persistent caching
Server replication
Security model for authentication, encryption and access control
Continued operation during partial network failures in server network
Network bandwidth adaptation
Good scalability
Well defined semantics of sharing, even in the presence of network failures
VFS: Virtual File System, intercepts the calls from client application or user processes and forwards them
either to the local file system or Venus.
Coda uses a local cache to provide access to server data when the network connection is lost.
During normal operation (Hoarding State) a user reads and writes to the file system normally, while
the client fetches, or "hoards", all of the data the user has listed as important in the event of
network disconnection.
If the network connection is lost, the Coda client's local cache serves data from this cache and logs
all updates. This operating state is called disconnected operation (Emulating State).
Upon network reconnection, the client moves to reintegration state; it sends logged updates to the
servers. Then it transitions back to normal connected-mode operation.
Client Structure
Venus is a user-level process which intercepts Unix file system calls via Sun Vnode
interface.
The Vnode forwards the system call to the Coda Mini Cache.
If the file is found in the Mini Cache serves the file and the control returns to
Application.
Otherwise the Mini Cache contacts Venus to service the call.
This in turn may involve contacting the CODA servers.
Control returns from Venus to application via mini-cache, updating the mini-cache
state as a side effect.
Measurements from the implementations confirm that Mini-cache is critical for
good performance.
Venus States
1. Hoarding: Normal operation mode
2. Emulating: Disconnected operation mode
3. Reintegrating: Propagates changes and detects inconsistencies
Hoarding state
In Hoarding state, Venus hoards the useful data in anticipation of disconnection. Venus manages its
cache in such a way that it balances the need of connected and disconnected operations. It uses Priority
Algorithm for cache updation.
Many factors complicate the implementation of hoarding :
File reference behaviour especially in the distant future cannot be predicted with certainty.
Disconnection and reconnection are often unpredictable.
Since cache space is finite, the availability of less critical objects may have to be sacrificed in favour
of more critical objects.
Emulating State
In Emulating State Venus performs many actions normally handle by servers. When the no. of services in
the client AVGS (Accessible Volume Storage Group) drops to zero then Venus transits to the Emulating
State. Venus emulated the behaviour of server and handles all the file requests using the locally
cached copy of the file.
Reintegration State
This is a transitory state through which the Venus passes in changing roles from pseudo-server to cache
manager. In this state Venus propagates changes made during emulation and updates its cache to
reflect current server state. Reintegration is performed one volume at a time. During this state
conflicts/inconsistencies are detected and resolved. During Reintegration if the connection with the
server is lost then the client is brought back to Emulating State.
Mobile Agents
What is a mobile agent?
Agent: Program that acts autonomously on behalf of a user (usually communicating with other
agents) i.e. “an independent software program, which runs on behalf of a network user”.
Mobile agent: Agent that migrates from machine to machine in an autonomous manner.
A mobile agent is a program that, once it is launched by a user, can migrate from node to node
autonomously in a heterogeneous network and can continue to function/ work on behalf of the
user/creator/author of the agent even if the user is disconnected from the network.
An agent is an object, hence it contains state/ data and methods. Among the instance data is an
itinerary of the sites to be visited, which may be dynamically constructed or adjusted. Other
data may include an agent ID or other authentication data. The agent’s behavior at each stop
can be pre-programmed and dynamically adjusted.
A mobile agent is not bound to the system on which it begins execution. It is free to travel
among the hosts in the network. Created in one execution environment, it can transport its
state and code with it to another execution environment in the network, where it resumes
execution. The term “state” typically means the attribute values of the agent that help it
determine what to do when it resumes execution at its destination. Code in an object-
oriented context means the class code necessary for an agent to execute.
This ability allows it to move to a system containing an object with which it wants to
interact and then to take advantage of being in the same host or network as the object.
There are no mobile agent applications, but there are plenty of applications that
benefit from using mobile agents.
i. E-commerce
Mobile agents are well suited for commerce. A commercial transaction may require real-time
access to remote resources, such as stock quotes and perhaps even agent-to-agent negotiation.
Different agents have different goals and implement and exercise different strategies to
accomplish them. We envision agents embodying the intentions of their creators, acting and
negotiating on their behalf. Mobile agent technology is a very appealing solution for this kind of
problem.
Security Measures:
Authentication – an agent must authenticate itself to the host, and an agent server must
authenticate itself to the agent.
Encryption – an agent encrypts its sensitive data.
Resource access – a host enforces strict access control to its resources.
Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin, Rich Miner, Nick
Sears and Chris White. Google acquired Android Inc. on August 17, 2005. Android was unveiled in 2007
along with the founding of the Open Handset Alliance—a consortium of hardware, software, and
telecommunication companies devoted to advancing open standards for mobile devices.
The first android phone was HTC G1. “It looked like a weapon. It was so sharp and jagged and full of hard
lines. It looked like you could cut yourself on the edges”.
Android is the fastest growing mobile OS with Over 300,000 Android activations a day. Over 1 million
applications are available in Google store with 1 billion downloads for these application.
Hardware
Android devices incorporate many optional hardware components, including still or video cameras, GPS,
hardware orientation sensors, dedicated gaming controls, accelerometers, gyroscopes, barometers,
magnetometers, proximity sensors, pressure sensors, thermometers, and touchscreens.
Some hardware components are not required, but became standard in certain classes of devices, such
as smartphones, and additional requirements apply if they are present.
AOSP also maintains the Android Compatibility Program, defining an "Android compatible" device "as
one that can run any application written by third-party developers using the AndroidSDK and NDK", to
prevent incompatible Android implementations..
Linux Kernel
The Linux kernel is the operating system kernel used by the Linux family of Unix-like operating systems.
It is one of the most prominent examples of free and open source software.) version 2.6. In computing,
the kernel is the main component of most computer operating systems; it is a bridge between
applications and the actual data processing done at the hardware level.
Android consists of a kernel based on the Linux kernel. Android relies on Linux Kernel 2.6 for core system
services
Middleware is computer software that provides services to software applications beyond those available
from the operating system. It can be described as "software glue". Middleware makes it easier for
software developers to perform communication and input/output, so they can focus on the specific
purpose of their application.
Android provides a middleware layer including libraries that provide services such as data storage,
screen display, multimedia, and web browsing. As the middleware libraries are compiled to machine
language, services execute quickly. Middleware libraries also implement device-specific functions, so
applications and the application framework need not concern themselves with variations between
various Android devices. Android's middleware layer also contains the Dalvik virtual machine and its
core Java application libraries
Core Libraries
The core libraries provide most of the functionality available in the core libraries of the Java language.
These APIs include support for
Data Structures
Utilities
File Access
Network Access
Graphics
Provides an environment on which every Android application runs. Each Android application runs in its
own process, with its own instance of the Dalvik VM. Dalvik has been written such that a device can run
multiple VMs efficiently.
While most Android applications are written in Java, there is no Java Virtual Machine in the platform and
Java byte code is not executed. Java classes are compiled into Dalvik executables and run on Dalvik, a
specialized virtual machine designed specifically for Android and optimized for battery-powered mobile.
.dex format is optimized for minimal memory footprint. Android uses the Dalvik virtual machine with
just-in-time compilation to run Dalvik dex-code (Dalvik Executable), which is usually translated from Java
bytecode. Dalvik VM runs the application relying on the Linux Kernel for Threading and Low-level
memory management.
Application Framework
This framework enables and simplifies the reuse of components. Developers have full access to
the same framework APIs used by the core applications. Users are also allowed to replace
components. The features of this framework and their respective roles are as given below
Feature Role
Resource Manager Providing access to non-code resources (localized strings, graphics, and
layout files)
Notification Manager Enabling all applications to display customer alerts in the status bar
Applications
Android provides a set of core applications:
Email Client
SMS Program
Calendar
Maps
Browser
Contacts
Etc
All applications are written using the Java language. The Android SDK tools compile your code—along
with any data and resource files—into an APK: an Android package, which is an archive file with
an .apk suffix. One APK file contains all the contents of an Android app and is the file that Android-
powered devices use to install the app.
Once Installed on a Device, each Android App Lives in its Own Security Sandbox:
The Android operating system is a multi-user Linux system in which each app is a different user. By
default, the system assigns each app a unique Linux user ID (the ID is used only by the system and is
unknown to the app). The system sets permissions for all the files in an app so that only the user ID
assigned to that app can access them. Each process has its own instance of virtual machine (VM), so an
app's code runs in isolation from other apps. By default, every app runs in its own Linux process. Android
starts the process when any of the app's components need to be executed, then shuts down the process
when it's no longer needed or when the system must recover memory for other apps.
Features
1. Handset layouts
The platform is adaptable to larger, VGA, 2D graphics library, 3D graphics library based on OpenGL
ES 2.0 specifications, and traditional smartphone layouts.
OpenGL for Embedded Systems (OpenGL ES or GLES):OpenGL for Embedded Systems (OpenGL ES or
GLES) is a subset of the OpenGL computer graphics rendering application programming interface
(API) for rendering 2D and 3D computer graphics such as those used by video games, typically
hardware-accelerated using a graphics processing unit (GPU). It is designed for embedded systems
like smartphones, computer tablets, video game consoles and PDAs.
2. Storage
SQLite, a lightweight relational database, is used for data storage purposes.
3. Connectivity
Android supports connectivity technologies including GSM/EDGE, CDMA, EV-DO, UMTS,
Bluetooth, Wi-Fi, LTE,NFC and WiMAX.
4. Messaging
SMS and MMS are available forms of messaging, including threaded text messaging
Android Cloud To Device Messaging (C2DM) is also a part of Android Push Messaging
service.
5. Search
Search is a core feature in android which enables a user to search any data on device or internet. It
has a feature to gives Search suggestions based on recent queries. It provide custom search
suggestions that match actual results in application data. It also has Voice Search feature based on
voice recognition which makes search quite convenient.
6. Locations & Maps
This is one of the most popular and compelling apps for mobile devices. Google Maps provides free
navigation which allows applications to access location services supported by device. Google
provides Maps external library. This application supports built-in downloading, rendering and
caching of Maps tiles, and other display options and controls.
7. Memory Management
Android is designed to manage memory (RAM) to keep power consumption at a minimum, in
contrast to desktop operating systems which generally assume they are connected to unlimited
mains electricity. When an Android app is no longer in use, the system will automatically suspend it
in memory – while the app is still technically "open", suspended apps consume no resources (for
example, battery power or processing power) and sit idly in the background until needed again. This
has the dual benefit of increasing the general responsiveness of Android devices, since applications
do not need to be closed and reopened from scratch each time, and also ensuring that background
applications do not consume power needlessly.
When memory is low, the system will begin killing apps and processes that have been inactive for a
while, in reverse order since they were last used (oldest first). This has the dual benefit of increasing
the general responsiveness of Android devices, since applications do not need to be closed and
reopened from scratch each time, and also ensuring that background applications do not consume
power needlessly.
Android manages the apps stored in memory automatically: when memory is low, the system will
begin killing apps and processes that have been inactive for a while, in reverse order since they were
last used (oldest first). This process is designed to be invisible to the user, such that users do not
need to manage memory or the killing of apps themselves.