Top Banner
Mobile Computing Lesson 01 DATABASE 1
36

Mobile Computing Database

Oct 03, 2015

Download

Documents

Sandra Maria

mc database introduction info
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

PowerPoint Presentation

Mobile Computing

Lesson 01 DATABASE1

Computations

Require data

Better to organise this data in a database

Database enables raising queries, datatransactions, and the retrieval of therequired section of data during acomputation

2

Database

A collection of systematically storedrecords or information

Is not just arbitrarily stored data withoutany logic

Stores data in a particular logical

manner, for example, as lookup tables

3

Lookup table

A database which stores information intabular form

Table structurethe first column areference for looking into the data

Subsequent column or columns containthe data

The referencekey to the data-values

4

Tags based database

Another logical structure

A tag is also the key to the data-values

For example, contact: 1 John, 2 Lucy.and address: 1 ABC Street, 2 DEFStreet.

contact and address tags in thedatabase

5

Business ( transactions) between theapplication software and database

Computational actions connecting to adatabase

Using the database for querying for arecord

Deleting a specific set of records

Modifications of records

insertions into the records and

Appending of the records

6

Transaction command

Command which is sent for retrieving thedata from the database, embodies thelogic used for obtaining (and storing) thedata

7

Data stored in databases

Follows a logic

Business logic indicates the logical wayin which transactions (business) carriedout

Between two ends, for example, betweendatabase-client (application) and

database-server or between an API anda database

8

API (application program interface)

A section of a program used to run anapplication (software)

API may run instructions to retrieve aqueried record from a database

The API may also issue outputs orqueries and commands to anotherprogram and receive the inputs fromanother program during a program-run

9

API at mobile device sending queries andretrieving data from local database

10

Transactions involving databases

Establishing connection between APIand database

Updating data records by inserting,adding, replacing, or deleting

Querying for records

Terminating the connection between theAPI and the database

11

Implicit Business Logic

Business logic indicates the logical

manner, flow, or pattern, in whichbusiness (or transactions) may becarried out with a database

Implicit business logic The structureand components of the database itselfdefine, which is used in retrieving (ormodifying) data from the database

12

Implicit Business Logic

The logic of transactions (business logic)implicit when it comes from within thedatabase

No external definition required for thebusiness logic to function

13

Example of Implicit Business Logic

Telephone Directory in which the firstword of each line is structured

alphabetically

14

The telephone directory

Names and telephone numbers arrangedalphabetically shows implicit businesslogic

Names and telephone numbers

structured in rows with each row havinga name and the corresponding addressand telephone number

15

Search directory in an XML database

Arranged alphabetically

Database designed using XML uses a tagas a key

The key enables business (transaction forretrieving, deleting, inserting, or modifyingdata)

16

Search directory in an XML database

Raj Kamal

ABC Street, .

9876543210

17

Search directory in an XML database

18

Explicit business logic

Stored queries and procedures definethe logic

A transaction (business) between the

API and the database uses an explicitlydefined query

19

Example of Explicit business logic

If Structure = most recently added entrylist Content_Type = English

English_Records, flight origin = Frankfurt,airline = Lufthansa, present time = 0800hrs and status = Not arrived thenGet_Records

20

Example of Explicit business logic

Another query for business can be

If flight origin = Frankfurt, airline =

Lufthansa, present time = 0800 hrs andstatus = arrived then Delete_Records

English_Records a section of thedatabase having English contents

Get_Records and Delete_Records twoprocedures that carry the transactions

21

Connectivity Protocol

An API that has predefined methods tohandle the various data access functions

Defines ways to connect to and access adatabase and methods for sending queriesand updating or retrieving databaserecords

Connects a client or server to thedatabase

22

Connectivity Protocols

Describes the set of permitted commands,transaction methods, and the order inwhich commands are interchangedbetween the API and the database at theserver or the client

24

Connectivity Protocols

Using the connectivity protocol API, aprogram issues commands

Access a database and query in order toselect and retrieve queried record(s) fromthe database

25

Examples of connectivity protocols

Java database connectivity (JDBC)

Open database connectivity (ODBC)

Simple object access protocol (SOAP)

Connect the server to the database

26

Relational Databases

Defined as a database structured inaccordance with the relational model

The relational model of data organizationhelps the database designer to create aconsistent and logical representation ofinformation

27

The relational model

Follows a relational logic which means thatit is assumed that all data can be

represented as n-ary (binary means n = 2,tertiary means n = 3,...) relations

An n-ary relation is a subset of theCartesian products of n-sets

28

Relational database

Entails that it is always possible to

mathematically model the relations

between the data records and get the

answers to the relational equations for thequeries

The answers are as in two-valuedpredicate logic

29

Two-valued predicate logic

Means that there are only two possibleresults on evaluation, for each

propositiontrue or false and no third

result, for example, null or unknown, ispossible

30

IBM DB2 Everyplace (DB2e)

A relational database engine

Needs a memory of about 100 kB

Designed to reside at the device

Supports databases of sizes up to 120 MB

An enterprise server employing DB2e

delivers and synchronizes the local copiesof data contents at mobile devices

31

DB2e based Synchronization

DB2e synchronizes with DB2 databases atthe synchronization, application, orenterprise server

Means that if a data record is modified atthe server then the copy of that record atthe client device also changes accordingly

32

API at mobile device retrieving datafrom database using DB2e

33

Summary

Database a collection of systematicallystored records or information

Business logic indicates the logical wayin which transactions (business) carriedout between two ends

XML database

Implicit Business Logic

Explicit business logic for Stored queries

and procedures

34

Summary

Transactions involving databases are

(a) establishing connection (b) updatingdata records by inserting, adding,replacing, or deleting, (c) querying and

(d) terminating the connection

Connectivity protocol

Relational databases

35

Summary

IBM DB2e EveryPlace for retrievingdatabase records and querying fromDB2e server

36

End of Lesson DATABASE37