Professional Documents
Culture Documents
Query languages are computer languages used to make queries into databases and
information systems.
SQL-
Broadly, query languages can be classified according to whether they are database query
languages or information retrieval query languages. Examples include:
DEDUCTIVE DATABASE
A general deductive database is a finite set of clauses of the form
a – l1,l2......lm
where a is an atom, m greater then equal to 0 and each li is a literal.
A combination of a conventional database containing facts, a knowledge base containing
rules, and an inference engine which allows the derivation of information implied by the
facts and rules.Commonly, the knowledge base is expressed in a subset of first-order
logic and either a SLDNF or Datalog inference engine is used.
A deductive database system is a database system which can make deductions (i.e.:
conclude additional facts) based on rules and facts stored in the (deductive) database.
Datalog is the language typically used to specify facts, rules and queries in deductive
databases. Deductive databases have grown out of the desire to combine logic
programming with relational databases to construct systems that support a powerful
formalism and are still fast and able to deal with very large datasets. Deductive databases
are more expressive than relational databases but less expressive than logic programming
systems. Deductive databases have not found widespread adoptions outside academia, but
some of their concepts are used in today's relational databases to support the advanced
features of more recent SQL standards.
Deductive databases were introduced over 30 years ago as a powerful extension to the relational data model
with recursive views. A deductive database consists of a set of facts that correspond to a relational database
and a set of logical rules
Deductive databases reuse a large number of concepts from logic programming; rules and
facts specified in the deductive database language Datalog look very similar to those in
Prolog. However, there are a number of important differences between deductive
databases and logic programming:
MOBILE DATABASE
A mobile database is a database that can be connected to by a mobile computing
device over a mobile network. The client and server have wireless connections. A cache
is maintained to hold frequent data and transactions so that they are not lost due to
connection failure. A database is a structured way to organize information. This could be
a list of contacts, price information or distance travelled.[1]
The use of laptops, mobiles and PDAs is increasing and likely to increase in the
future[citation needed] with more and more applications residing in the mobile systems. While
those same analysts can’t tell us exactly which applications will be the most popular, it is
clear that a large percentage will require the use of a database of some sort. Many
applications such as databases would require the ability to download information from an
information repository and operate on this information even when out of range or
disconnected.
An example of this is a mobile workforce. In this scenario user would require to access
and update information from files in the home directories on a server or customer records
from a database. This type of access and work load generated by such users is different
from the traditional workloads seen in client–server systems of today. With the advent of
mobile databases, now users can load up their smart phones or PDAs with mobile
databases to exchange mission-critical data remotely without worrying about time or
distance. Mobile databases let employees enter data on the fly. Information can be
synchronized with a server database at a later time.
Three parties
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. They are typically
low-power devices such as mobile phones, portable phones, or wireless routers.
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.
MOBILE COMPUTING
Mobile computing is a form of human–computer interaction where a computer is
expected to be transported during normal usage. Mobile computing has three aspects:
mobile communication, mobile hardware and mobile software. The first aspect addresses
communication issues in ad-hoc and infrastructure networks as well as communication
properties, protocols, data formats and concrete technologies. The second aspect focusses
on the hardware, i.e. mobile devices or device components. The third aspect deals with
the characteristics and requirements of mobile applications.
Definitions
Mobile computing is "taking a computer and all necessary files and software out into the
field."
"Mobile computing: being able to use a computing device even when being mobile and
therefore changing location. Portability is one aspect of mobile computing."[
Devices
Many types of mobile computers have been introduced since the 1990s, including the
• Wearable computer
• Personal digital assistant/enterprise digital assistant
• Smartphone
• Carputer
• Ultra-Mobile PC
Mobile Internet access is generally slower than direct cable connections, using
technologies such as GPRS and EDGE, and more recently HSDPA and HSUPA 3G
networks. These networks are usually available within range of commercial cell phone
towers. Higher speed wireless LANs are inexpensive, but have very limited range.
• Security standards
When working mobile one is dependent on public networks, requiring careful use of
VPNs.
• Power consumption
When a power outlet or portable generator is not available, mobile computers must rely
entirely on battery power. Combined with the compact size of many mobile devices, this
often means unusually expensive batteries must be used to obtain the necessary battery
life.
• Transmission interferences
Weather, terrain, and the range from the nearest signal point can all interfere with signal
reception. Reception in tunnels, some buildings, and rural areas is often poor.
More car accidents are related to drivers who were talking through a mobile device. Cell
phones may interfere with sensitive medical devices. There are allegations that cell phone
signals may cause health problems.[citation needed]
Screens and keyboards tend to be small, which may make them harder to use. Alternate
input methods such as speech or handwriting recognition require training.
Isolation refers to the requirement that other operations cannot access data that has been
modified during a transaction that has not yet completed. The question of isolation occurs
in case of concurrent transactions (multiple transactions occurring at the same time).
Each transaction must remain unaware of other concurrently executing transactions,
except that one transaction may be forced to wait for the completion of another
transaction that has modified data that the waiting transaction requires. If the isolation
system does not exist, then the data could be put into an inconsistent state. This could
happen, if one transaction is in the process of modifying data but has not yet completed,
and then a second transaction reads and modifies that uncommitted data from the first
transaction. If the first transaction fails and the second one succeeds, that violation of
transactional isolation will cause data inconsistency. Due to performance and
deadlocking concerns with multiple competing transactions, many modern databases
allow dirty reads, which is a way to bypass some of the restrictions of the isolation
system. A dirty read means that a transaction is allowed to read, but not modify, the
uncommitted data from another transaction.
Each transaction (Ti) is an ordered list of actions (Aix). Before the transaction performs its
first action (Ai1), it is marked with the current timestamp, or any other strictly totally
ordered sequence: TS(Ti) = NOW(). Every transaction is also given an initially empty set
of transactions upon which it depends, DEP(Ti) = [], and an initially empty set of old
objects which it updated, OLD(Ti) = [].
Each object (Oj) in the database is given two timestamp fields which are not used other
than for concurrency control: RTS(Oj) is the time at which the value of object was last
used by a transaction, WTS(Oj) is the time at which the value of the object was last
updated by a transaction.
Whenever a transaction starts, it is given a timestamp. This is so we can tell which order
that the transactions are supposed to be applied in. So given two transactions that affect
the same object, the transaction that has the earlier timestamp is meant to be applied
before the other one. However, if the wrong transaction is actually presented first, it is
aborted and must be restarted.
Every object in the database has a read timestamp, which is updated whenever the
object's data is read, and a write timestamp, which is updated whenever the object's data
is changed.
• but the transaction started before the object's write timestamp it means that
something changed the object's data after the transaction started. In this case, the
transaction is canceled and must be restarted.
• and the transaction started after the object's write timestamp, it means that it is
safe to read the object. In this case, if the transaction timestamp is after the
object's read timestamp, the read timestamp is set to the transaction timestamp.
• but the transaction started before the object's read timestamp it means that
something has had a look at the object, and we assume it took a copy of the
object's data. So we can't write to the object as that would make any copied data
invalid, so the transaction is aborted and must be restarted.
• and the transaction started before the object's write timestamp it means that
something has changed the object since we started our transaction. In this case we
use the Thomas Write Rule and simply skip our write operation and continue as
normal; the transaction does not have to be aborted or restarted
• otherwise, the transaction writes to the object, and the object's write timestamp is
set to the transaction's timestamp.
Timestamp Resolution
This is the minimum time elapsed between two adjacent timestamps. If the resolution of
the timestamp is too large (coarse), the possibility of two or more timestamps being equal
is increased and thus enabling some transactions to commit out of correct order. For
example, assuming that we have a system that can create one hundred unique timestamps
per second, and given two events that occur 2 milliseconds apart, they will probably be
given the same timestamp even though they actually occurred at different times.
Timestamp Locking
Even though this technique is a non-locking one, in as much as the Object is not locked
from concurrent access for the duration of a transaction, the act of recording each
timestamp against the Object requires an extremely short duration lock on the Object or
its proxy.
Overview/Main Points
• Definitions:
o Failure: An event at which the system does not perform according to
specifications. There are three kinds of failures:
1. failure of a program or transaction
2. failure of the total system
3. hardware failure
o Recovery Data: Data required by the recovery system for the recovery of
the primary data. In very high reliability systems, this data might also need
to be covered by a recovery mechanism... Data recovery data is divided
into two categories : 1) data required to keep current values, and 2) data to
make the restoration of previous values possible.
o Transaction: The base unit of locking and recovery (for undo, redo, or
completion), appears atomic to the user.
o Database:A collection of related storage objects together with controlled
redundancy that serves one or more applications. Data is stored in a way
that is independent of programs using it, with a single approach used to
add, modify, or retrieve data.
o Correct State:Information in the database consists of the most recent
copies of data put in the database by users and contains no data deleted by
users.
o Valid State:The database contains part of the information of the correct
state. There is no spurious data, although pieces may be missing.
o Consistent State:In a valid state, with the information contained
satisfying user consistency constraints. Varies depending on the database
and users.
o Crash:A failure of a system that is covered by a recovery technique.
o Catastrophe:A failure of a system not covered by a recovery technique.
• Possible Levels of Recovery:
The bigger the damage, the cruder the recovery technique used.
• Recovery Techniques:
1. Salvation program: Run after a crash to attempt to restore the system to a valid
state. No recovery data used. Used when all other techniques fail or were not used. Good
for cases where buffers were lost in a crash and one wants to reconstruct what was lost...
(4,5)
2. Incremental dumping: Modified files copied to archive after job
completed or at intervals. (3,4)
3. Audit trail: Sequences of actions on files are recorded. Optimal for
"backing out" of transactions. (Ideal if trail is written out before changes).
(1,2,3)
4. Differential files: Separate file is maintained to keep track of changes,
periodically merged with the main file. (2,3)
5. Backup/current version: Present files form the current version of the
database. Files containing previous values form a consistent backup
version. (2,3)
6. Multiple copies: Multiple active copies of each file are maintained during
normal operation of the database. In cases of failure, comparison between
the versions can be used to find a consistent version. (6)
7. Careful replacement: Nothing is updated in place, with the original only
being deleted after operation is complete. (2,6)
(Parens and numbers are used to indicate which levels from above are supported
by each technique).
Relevance
Recovery from failure is a critical factor in databases. In case of disaster, it is very
important that as much as possible (if not everything) is recovered. This paper surveys
the methods that we in use at the time for data recovery.
SPATIAL DATABASE
A spatial database is a database that is optimized to store and query data that is related
to objects in space, including points, lines and polygons. While typical databases can
understand various numeric and character types of data, additional functionality needs to
be added for databases to process spatial data types. These are typically called geometry
or feature. The Open Geospatial Consortium created the Simple Features specification
and sets standards for adding spatial functionality to database systems.[
1 What is a Spatial Database System?
In various fields there is a need to manage geometric, geographic, or spatial data, which
means datarelated to space. The space of interest can be, for example, the two-
dimensional abstraction of (partsof) the surface of the earth – that is, geographic space,
the most prominent example –, a man-madespace like the layout of a VLSI design, a
volume containing a model of the human brain, or another3d-space representing the
arrangement of chains of protein molecules. At least since the advent ofrelational
database systems there have been attempts to manage such data in database systems.
Characteristic for the technology emerging to address these needs is the capability to deal
with largecollections of relatively simple geometric objects, for example, a set of 100 000
polygons. This issomewhat different from areas like CAD databases (solid modeling etc.)
where geometric entities arecomposed hierarchically into complex structures, although
the issues are certainly related.
Several terms have been used for database systems offering such support like pictorial,
image,geometric, geographic, or spatial database system. The terms “pictorial” and
“image” databasesystem arise from the fact that the data to be managed are often initially
captured in the form of digitalraster images (e.g. remote sensing by satellites, or computer
tomography in medical applications).
The term “spatial database system” is associated with a view of a database as containing
sets objects in space rather than images or pictures of a space. Indeed, the requirements
and techniques for dealing with objects in space that have identity and well-defined
extents, locations, and relationships are rather different from those for dealing with raster
images. It has therefore been suggested to clearly distinguish two classes of systems
called spatial database systems and image database spatial DBMS provide the
underlying database technology for geographic information systems (GIS) and other
applications
.
In addition to typical SQL queries such as SELECT statements, spatial databases can
perform a wide variety of spatial operations. The following query types and many more
are supported by the Open Geospatial Consortium:
• Spatial Measurements: Finds the distance between points, polygon area, etc.
• Spatial Functions: Modify existing features to create new ones, for example by
providing a buffer around them, intersecting features, etc.
• Spatial Predicates: Allows true/false queries such as 'is there a residence located
within a mile of the area we are planning to build the landfill?'
• Constructor Functions: Creates new features with an SQL query specifying the
vertices (points of nodes) which can make up lines. If the first and last vertex of a
line are identical the feature can also be of the type polygon (a closed line).
• Observer Functions: Queries which return specific information about a feature
such as the location of the center of a circle
Not all spatial databases support these query types.