Mobile Databases

A mobile database is accessed from portable devices (phones, laptops) over a wireless network. The architecture has fixed hosts with the main databases, base stations that connect the wireless cell, and mobile units that move between cells. Characteristics and issues:

  • Disconnection: the device may be offline for long periods, so it keeps a local cache or replica and works disconnected.
  • Limited bandwidth, battery and storage: the amount of communication and processing is kept small.
  • Location-dependent data and queries ("the nearest petrol pump") and the handling of handoff between cells.
  • Replication and synchronisation: changes made offline are merged on reconnection and conflicts are resolved by rules such as last-writer-wins or by the user.
  • Transactions: long disconnections need relaxed models (reporting transactions, check-out of data) rather than holding locks.
  • Security of data on lost devices.

Multimedia Databases

A multimedia database stores images, audio, video, graphics and text together with their descriptive data. Media objects are very large, so they are kept as BLOBs or in file storage, with metadata in tables.

  • Content-based retrieval: instead of searching by keywords, objects are described by feature vectors, such as a colour histogram, texture or shape for images, and pitch or rhythm for audio. A query by example returns the objects whose vectors are most similar (smallest distance) to the query vector.
  • Similarity search uses distance measures (Euclidean, cosine) and multidimensional indexes (R-tree, M-tree) with dimensionality reduction.
  • Continuous media (video, audio) need quality of service: data must arrive at a steady rate (streaming), so there are real-time delivery, buffering and compression (JPEG, MPEG, MP3).
  • Applications: digital libraries, medical images, video on demand, face recognition and news archives.

Definition: Content-based retrieval. Finding multimedia objects by comparing numerical features extracted from the content, such as colour or shape, instead of by text descriptions.

Table 4.4: Mobile and multimedia databases

Type Main challenge Technique
Mobile Disconnection, low bandwidth Caching, synchronisation
Multimedia Large size, similarity Feature vectors, indexes
Continuous media Steady delivery Streaming, compression

Example 4.4: Content-based image retrieval

Problem: Images are described by the fractions of red, green and blue: Img1 (0.5, 0.3, 0.2), Img2 (0.1, 0.2, 0.7) and Img3 (0.6, 0.25, 0.15). The query image has (0.6, 0.3, 0.1). Which image is the most similar?

Solution:

  1. Img1: √(0.1² + 0 + 0.1²) = √0.02 = 0.141.
  2. Img2: √(0.5² + 0.1² + 0.6²) = √0.62 = 0.787.
  3. Img3: √(0 + 0.05² + 0.05²) = √0.005 = 0.071.
  4. The smallest distance means the greatest similarity.

Result: Img3 is the best match (distance 0.071), followed by Img1 (0.141) and Img2 (0.787).

from math import dist
images = {"Img1": (0.5, 0.3, 0.2), "Img2": (0.1, 0.2, 0.7),
          "Img3": (0.6, 0.25, 0.15)}
query = (0.6, 0.3, 0.1)
ranked = sorted((dist(v, query), k) for k, v in images.items())
for d, k in ranked:
    print(k, "distance", round(d, 3))
print("Best match:", ranked[0][1])
server = {"phone": ("123", 5)}      # value, version
device = {"phone": ("456", 6)}
merged = max(server["phone"], device["phone"], key=lambda t: t[1])
print("After synchronisation (higher version wins):", merged)

Output

Img3 distance 0.071
Img1 distance 0.141
Img2 distance 0.787
Best match: Img3
After synchronisation (higher version wins): ('456', 6)

Common mistakes

  • Holding locks on server data while a mobile device is disconnected.
  • Searching images only by file names and ignoring content.
  • Sending full-size media over a slow wireless link.
  • Resolving synchronisation conflicts silently without a clear rule.

Key takeaways

  • Mobile databases deal with disconnection, low bandwidth and location-dependent queries.
  • Synchronisation merges offline changes and resolves conflicts.
  • Multimedia retrieval compares feature vectors by distance.
  • Continuous media need streaming with quality of service.

Practice questions

  1. Why do mobile databases use caching?
  2. What is query by example in multimedia retrieval?
  3. Name two multimedia data types.

Answers to the practice questions

  1. So that the device can work while disconnected.
  2. Giving a sample object and retrieving the most similar objects by content.
  3. Images and video (also audio and graphics).

Sources

  • Official BCA syllabus Advanced Database Systems, course code 25BCA406DS04, Unit IV