Database concepts

Posted in Computing, Databases

A database is a collection of data which can be used by multiple different applications. This solves problems inccured from a non-database approach such as redudnancy and inconsistancy.

Database management system (DBMS)

A database management system (DBMS) is a piece of software which controls access to a database. They enable program-data independance - where the storage of the data is 'hidden' from the application accessing and using it - and user access - users can be limited to what they are allowed to see and actions they can perform. The DBMS acts as an interface between an application or user and the data stored in the database.

The DBMS helps solve problems of just using a database on it's own. Unproductive maintenance occurs when one application wants to change the structure of the database. This means all other applications need to be changed. The DBMS solves this problem because it is program-data independant. The applications are independant of the data they are using. The second problem of a stand alone database is security - applications can access data kept by other applications. The DBMS can restrict an application/users permissions so they can view only what they need.

Three level architecture of a DBMS

There are three levels of a DBMS, each level is a view of the database from a different perspective/standpoint

  • External/user schema - the view of the database from the end user/application. If a database has more than one user than there will be different user schema's depending on a user's permissions.
  • Conceptual/logical schema - the overall view of the entire database - entities, attributes and relationships.
  • Internal/storage schema - the view of the storage of the data. This level describes how files are organised and accessed.

Concurrent access to data

Concurrent access to data occurs in a multi-access database where more than one user is able to access and change the same piece of data. This has the problem that should they change the information at the same time some data will be lost or corrupted.

Locking

A DBMS solves this problem by using 'locking' - this stops other users editing or opening a record another user currently has open. The whole database may be locked, the whole table or the record being edited. Alternatively no locks could be specified and the DBMS would decide when to lock parts of the database automatically.

Deadlock

Deadlock occurs when two users access two records, causing both to become locked, then wanting to go on and edit the record the other is editing, neither can continue. A DBMS overcomes this problem by aborting one of the user's task to give the other user the ability to continue.

ODBC (Open Database Connectivity)

An ODBC is an interface provides a way for applications to work seemlessly with different types of database. An application written to use ODBC will be able to work on any database which is ODBC compliant. The ODBC interface works by taking the requests from the application and translating them into requests the type of database it is accessing can understand.

Client-server database operation

A DBMS can operate in client-server mode. In this respect the DBMS server (or database server) is hosted on a dedicated server and processes requests from the DBMS client which is hosted on the client's software (i.e. computer/workstation). The DBMS client sends a request to the server which processes the request and returns the data back to the client who requested it.

Object-oriented databases

An object-oriented database offers a DBMS with object-oriented programming by storing data and methods as objects.