Databases for mobile applications ·  · 2017-03-13Protocol) Disponibilidad ... DBMS completo...

58
DR. MIGUEL ÁNGEL OROS HERNÁNDEZ Databases for mobile applications

Transcript of Databases for mobile applications ·  · 2017-03-13Protocol) Disponibilidad ... DBMS completo...

D R . M I G U E L Á N G E L O R O S H E R N Á N D E Z

Databases for mobileapplications

Agenda

Databases formobileapplications

Mobile applicationsfeatures

Relationship with data manipulation and personalization

Mobile computingarchitectures

Data distribution and data replication

Definición, historia y características

Bases de datos móviles

Bases de datos móvilesinicios

Radiofrecuencia

1886-1888: James Clerk Maxweelm, Henrich Rudolf Hertz

Primeros usos Nikola Tesla, Guillermo Marconi, Alejandro Steapanovich

Radiocomunicaciones

Radar

Radioastronomía

Dispositivos móviles

Dispositivos móviles

Capacidad de hardware

Sistema operativo

Conectividad

Aplicaciones necesarias

Sistema de Administración de Bases de Datos Móvil (SABDM)

Sistemas de geolocalización

Seguridad

Internet y Conexiones inalámbricas

Motivación ¿base de datos móvil?

Dispositivos móviles

Laptop

Teléfono

PDA

Uso en aumento de dispositivos móviles

Evidente uso de bases de datos

Base de datos instalada en un dispositivo móvil a través de una red móvil

Portable

Conexiones inalámbricas para el cliente y el servidor

Memoria cache para los datos frecuentes y transacciones para no perderlos en caso de fallo de conexión

Bases de datos móviles

Otra definiciónSistemas de bases de datos móviles

Bases de datos donde los usuarios pueden acceder a la información almacenada en un lugar físicamente diferente utilizando conexiones inalámbricas

SABDM Soportan conectividad

móvil para Consultar ModificarInformación de la base de datos local al dispositivo móvil o centralizado

Sincronización entre las bases: sincrona o asíncrona

Bases de datos móviles

Bases de datos móvilesHistoria

Perspectiva: Tiempo Real

Inicio: Desconexión aplicaciones inalámbricas

para dispositivos móviles desconectados de las empresas o sistemas

Palm Pilots

Libretas de direcciones, horarios, etc.

Bases de datos pequeñas

Surgimiento redes inalámbricas Problemas de dispositivos

inalámbricos y teléfonos WAP (Wireless ApplicationProtocol)

Disponibilidad

Memoria

Tamaño de pantalla

Volúmenes de información

Conexión a WWW

Portabilidad inalámbrica

Introducir datos sobre la marcha, sincronización

Bases de datos móvilesHistoria

Bases de datos móvilesCaracterísticas

Servicios de bases de datos relacionales requiriendo poca memoria

Análisis y manipulación de datos utilizando dispositivos móviles

Manejo de queries

Opción de los usuarios para

Trabajo en línea con un servidor central SABD

Descarga de datos

Captura en tiempo real y sincronización posterior

Negocios Sector Público

Información sobre clientes, competidores, tendencias de mercado, ventas

Anytime, anywhere, …

US Army la utiliza para consulta de inventarios

Bases de datos móvilesAlgunas aplicaciones

Taxi dispatch

Gasolinerías cercanas

Control de tráfico

E-commerce

Hoteles más cercanos

Sector Salud

Almacenamiento y consulta durante las rondas de los médicos

Consulta de la historia clínica y tratamientos del paciente a distancia

Bases de datos móvilesalgunas aplicaciones

Tipos de aplicaciones Clasificación de datos

Verticales Los beneficiarios permiten

que la información pueda ser determinada

Horizontales Reportes distribuidos

Lo usuarios pueden ingresar a las celdas

Ejemplo: correo electrónico

Privados Propiedad del usuario

Sólo él puede manejarlos

Públicos Examinados y modificados

por cualquier usuario

Compartidos Acceso para algunos usuarios

en lectura y escritura

Bases de datos móviles

Sistemas de bases de datos móviles (MDS)

Procesamiento de consultas

Sistemas distribuidos con conectividad móvil

Capacidades de un DBMS completo

Movilidad espacial

Construido sobre plataformas PCS/GSM

Capacidades inalámbricas

Dependencia de la localización física de la unidad móvil

Tiempos de sincronización de datos

Confirmación de operaciones

Transmisión de información para ejecutar operaciones

Ejecuciones locales Autonomía vs Consistencia

Bases de datos móviles

Transacciones Tecnología inalámbrica

De un dispositivo móvil hacia la base de datos o servidor fijo

Considerar Desconexiones Movilidad Errores Fallas en el dispositivo móvil

Mantenimiento de la autonomía y consistencia local del DBMS

1996: inicios

Palm o Pocket PC

1997

Conectividad inalámbrica utilizando WAP (WirelssApplication Protocol)

Bases de datos móviles

Redes inalámbricas (tipos)

Tipos de dispositivos móviles

CelularCostos elevados con poco ancho de banda, Buena cobertura

LAN inalámbricaBajo costo, poco rango de cobertura, buen ancho de banda (54 Mbps)

SatelitalMuy costosa, amplia cobertura, gran ancho de banda en sentido descendente y poco ascendente

Redes Ad HocComunicación directa entre dispositivos (Bluetooth)

PDA (Personal Digital Assistant)

Palm

Pocket PCs

Teléfono celular con conexión a Internet

Bases de datos móviles

ConectividadInteracción con localización

Fallas de conexión

Velocidad de conexión

Tipos de conexión

Protocolos soportados

Dependencia de la localización física del dispositivo para el procesamiento de consultas

Involucran sistemas de geo-localización

Movimiento de la unidad durante la consulta

Ejemplos: hotel más cercanos, ruta más corta, …

Bases de datos móviles

Bases de datos móvilesEstructura y características

Corporativo

Servidor de base de datos corporativo

DBMS gestionando datos y aplicaciones corporativas

Bases de datos remota

DBMS gestionando y almacenado datos móviles

Implementadas en los dispositivos móviles

Plataforma (Laptop, PDA con acceso Internet)

Enlaces de comunicación entre el DBMS Corporativo y el DBMS móvil

Arquitecturas, SABD y Servicios

Bases de datos móvilesArquitectura

Bases de datos móvilesArquitectura

Bases de datos móvilesSABDM

Comunicación entre SABDM y SABD relacionales

SABDM adaptados a los recursos limitados de las unidades móviles

Funcionalidades adicionales

Comunicación inalámbrica con el servidor centralizado de base de datos

Replicación y sincronización de datos

En el dispositivo móvil

Gestión de datos

Análisis de datos

Bases de datos móvilesTransacciones

A mobile transaction (MT) can be defined as

Ti is a triple <F, L, FLM>; where

F = {e1, e2,…, en} is a set of execution fragments,

L = {l1, l2,…, ln} is a set of locations, and

FLM = {flm1, flm2, …, flmn} is a set of fragment

location mapping where j, flmi (ei) = li

Bases de datos móvilesTransacciones

An execution fragment eij is a partial order eij =

{j, j}where

o i = OSj {Ni} where OSj = kOjk, Ojk {read,

write},

and Nj {AbortL, CommitL}

o For any Ojk and Ojl where Ojk = R(x) and Ojl = W(x)

for data object x, then either Ojk j Ojl or Ojl j Ojk

Bases de datos móvilestransacciones: Kangaroo Transaction

It is requested at a MU but processed at DBMS on the fixed network

The management of the transaction moves with MU

Each transaction is divided into subtransactions

Two types of processing modes are allowed, one ensuring overall atomicity by requiring compensating transactions at the subtransactionlevel

Reporting Co-Transactions

The parent transaction

(workflow) is represented in

terms of reporting and co-

transactions which can

execute anywhere

A reporting transaction can

share its partial results with

the parent transaction

anytime and can commit

independently

A co-transaction is a special class of reporting transaction, which can be forced to wait by other transaction

Bases de datos móvilestransacciones

Bases de datos móvilestransacciones: Clustering

A mobile transaction is decomposed into a set of

weak and strict transactions

The decomposition is done based on the

consistency requirement

The read and write operations are also classified as

weak and strict

Bases de datos móvilestransacciones: Semantic Based

The model assumes a mobile transaction to be a

long lived task and splits large and complex objects

into smaller manageable fragments

These fragments are put together again by the

merge operation at the server

If the fragments can be recombined in any order

then the objects are termed reorderable objects

Serialization of concurrent execution

Reasons these methods may

not work satisfactorily

Two-phase locking based (commonly used)

Timestamping

Optimistic

Wired and wireless message overhead

Hard to efficiently support disconnected operations

Hard to manage locking and unlocking operations

Bases de datos móvilestransacciones

Bases de datos móvilestransacciones: serialización

New schemes based on timeout, multiversion, etc., may work

A scheme, which uses minimum number of messages, especially wireless messages is required

Database Frontend Database Backend

C, C++

Java

Visual Studios (C++, VB, C#, J#)

Appforge – Mobile VB

Sybase’s Ultralite Oracle Lite MS-Pocket Access MS-SQL Server CE Pointbase SmallSQL Pyrrho DBMS ScimoreDB HSQLDB Embedded MySQL DataGlass mobile database by

Impathic

Bases de datos móvilesAmbientes

Bases de datos móvilesSybase’s Ultralite

Market Leader (over 60% of mobile market)

Mobilink (Synchronization Server) and Ultralite(Mobile Database)

Can synchronize Data to Databases of different Vendors (not tied to Sybase’s Enterprise Edition).

Ultralite comes with Appforge’s Mobile VB

Oracle Lite

Very Powerful

supports 100% Java development (through JDBC drivers and the database's native support for embedded SQLJ and Java stored procedures)

Supports programming from any development tool that supports ODBC (Visual Basic, C++, Delphi, and so on).

WindowsCE (Pocket) and PalmOS (Palm).

Includes Mobile SQL that is the mobile equivalent of Oracle's SQL*Plus tool.

Only Oracle DBMS significantly different

Oracle Lite

Max. Database size 4 Gb

Client support Palm & Pocket PC

Hardware requiments 1 Mb RAM, 5 Mb Disk

Indexing Only B+ trees

File structure 1 DB file

Bases de datos móvilesOracle Database Lite 10g

Oracle Lite

the Mobile Server product manages the synchronization of data to and from the mobile device (similar to Sybase’s Mobilink)

Unlike the Sybase, Oracle9i Lite assumes the use of Oracle databases on the Server

Extremely Large Footprint (especially when using Web-to-go or Wireless Bandwith)

a component of Oracle9i Lite (wizard), consists of a collection of modules and services that facilitate development, deployment, and management of mobile Web applications.

Allows Oracle Lite users to perform replication, synchronization, and other networking issues without coding

Oracle LiteNot supported

PL/SQL (use Java Stored Procedures and triggers instead)

Oracle Light is intended as a small, single-user client database and do not support any server functionalities like Java CORBA ORB's, SQL*Net Listeners, etc.

Only a few selected dictionary views are available, ALL_TABLES, ALL_VIEWS, ALL_USERS, CAT, etc.

An Oracle Lite database can only be queried from a remote client if it's data is replicated.

Oracle LiteTutoriales

http://www.oracle.com/technology/tech/wireless/tutorials/lite_windowscetutorial11-02.pdf

http://www.oracle.com/technology/products/lite/tutorials/index.html

Pocket Access 2002SQL Server 2000 Windows CE

ADOCE database access classes

for smaller database applications that need to operate on a small number of tables

Pocket Access files are stored using the .cdbextension and are populated by one or more tables from a desktop Access database

Replication/Synchronization is very simple, through ActiveSync

ADOCE database access classes or OLE DB/CE

replication with an enterprise SQL Server data store as well as advanced database capabilities.

Synchronized through RDA or Merge Replication (both through IIS)

Microsoft

Microsoft SQL Server CE

Pointbase

Like Oracle Lite, Java Based

wide variety of platforms (more than Oracle Lite)

Its founder: Bruce Scott, cofounder of Oracle (with Larry Ellison)

HSQLDB

Hyperthreaded Structured Query Language

Written in Java

Offers JDBC Driver

100-600k

Cross Platform

OpenOffice & Mathematica

ScimoreDB Embedded

Distributed Query Language (DQL)

Text based query language

Windows Only

C++

ACID

Independent process or part of your application

Free

4MB (A relatively small footprint in comparison)

SmallSQL

Java

JDBC Driver

200k

No Installation Required

Provides no network interface or user management...so what’s it good for

SQLite

ACID

C

Cross Platform

500K

Uses a Single Database File

FREE!

Not a stand alone process

A library?

Linked Function Calls

Dynamically Typed (Read Weakly)

C, C++, Java, C#, and LISP bindings available

SQLite3

SQLite

SQLite3 - Stand alone application provides:

create database

define tables

insert and change rows

run queries

manage database

Single application (Resides on the host machine)

SQLitecode examples

Because of weak typing and the use of a single database file several layers may be necessary.

SQLiteDatabaseCalls

#include "sqlite3.h"

/*Minimal SQLite3 Interface this provides the only access to SQLite3 library functions*/

sqlite3* createDatabase(char *pFilename);int getDataFromDB(sqlite3* db, const char* sqlCommand, char** & data, int

& rows, int & cols);int clearOldData(sqlite3* db, const char* sqlCommand);int insertResults(sqlite3* db, int currentTime, constchar* sqlCommand);int clearEntries(sqlite3* db, const char* sqlCommand);

SQLite IRL

125 million copies in Mozilla Firefox.

20 million Mac OS X computers, each of which contains multiple copies of SQLite. (In Mac OS X v10.4 Apple introduced SQLite as a persistence layer of the Core Data API.)

300 million downloads of Skype. (The Skype service has 100 million registered users.)

Nokia phones with Symbian OS version 9.4 or later. (The first one is Nokia 5800)

Every iPhone and iPod touch.

Google Android phones like the T-Mobile G1

SQLiteClientes famosos

Adobe

Airbus

Dropbox

Google

Intuit

McAfee

Mozilla

Php

Python

REALbasic

Skype

Sun

Symbian

Bases de datos móvilesServicios

Comunicación con el servidorcentralizado de la base de datos

Replicar datos en el servidor de bases de datos centralizado y en el dispositivo móvil

Capturar datos de variasfuentes, p.e. Internet

Gestionar datos en el dispositivo móvil

Analizar los datos almacenadosen el dispositivo móvil

Crear aplicaciones móvilespersonalizadas

Google Google Mobile

Google SMS

Google Maps for Mobile

Yahoo Yahoo! Mobile

Yahoo! Go

Others AOL, MSN, 4INFO, …

Google Mobile

http://mobile.google.com/

(XHTML)

(WML)

Google Mobile

Google Maps for mobile

Ventajas Inconvenientes

Movilidad de los usuarios Acceso remoto

Comodidad

Costos transporte físico

Mercado potencial amplio

Variedad de aplicaciones

Competencia entre fabricantes disminuyen costos de terminales

Dependencia de conexión Cobertura de red

Costos de transmisión

Tipos de red

Seguridad de transmisión

Estabilidad

Consistencia y Coherencia de BD

Fallos complejos propios de entornos distribuidos

Capacidad de terminales

Bases de datos móviles

Bibliografía

“Comparison of relational database management systems.” Wikipedia: The Free Encyclopedia. 15 November 2008 http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems

“HSQLDB.” 15 November 2008 <http://hsqldb.org/> “SmalSQL Database - the Java Desktop Database with JDBC interface.” 15

November 2008 <http://www.smallsql.de/> “Scimore - High performance distributed, client/server and fully feature

embeded SQL database.” 15 November 2008 <http://www.scimore.com/> “SQLite Documentation.” 15 November 2008

http://www.sqlite.org/docs.html Bases de datos móviles

https://modelosbd2012t1.wordpress.com/2012/03/15/base-de-datos-moviles-3/

Bases de datos móviles https://prezi.com/bs5cs5xhlsj6/bases-de-datos-moviles/

Mobile dbms http://es.slideshare.net/Tech_MX/mobile-dbms

Fin