Database abstraction layer: Difference between revisions

Content deleted Content added
Joaeron (talk | contribs)
Expanded on the purposes and responsibilities of the layers
Line 5:
 
=== Physical level (lowest level) ===
The lowest level connects to the database and performs the actual operations required by the users. At this level the conceptual instruction has been translated into multiple instructions that the database understands. Executing the instructions in the correct order allows the DAL to perform the conceptual instruction.
It defines how data is stored. It is very complex and used by developers.
 
Implementation of the physical layer may use database specific APIs or use the underlying language standard database access technology and the database's version SQL.
 
Implementation of data types and operations are the most database specific at this level.
=== Conceptual or logical level (middle or next highest level) ===
The conceptual level consolidates external concepts and instructions into an intermediate data structure that can be devolved into physical instructions. This layer is the most complex as it spans the external and physical levels. Additionally it needs to span all the supported databases and their quirks, APIs, and problems.
It defines data in terms of a data model. It tells what data is stored and described in small numbers. This level is usually used by '''DBA''' (Database administrator)
 
This level is aware of the differences between the databases and able to construct an execution path of operations in all cases. However the conceptual layer defers to the physical layer for the actual implementation of each individual operation.
=== External or view level ===
The external level is exposed to users and developers and supplies a consistent pattern for performing database operations.
It defines a number of simplified ___domain-specific views. It describes only part of databases. This level is used by users.
<ref>http://www.dmst.aueb.gr/dds/etech/db/abstr.htm</ref> Database operations are represented only loosely as SQL or even database access at this level.
 
Every database should be treated equally at this level with no apparent difference despite varying physical data types and operations.
 
== Database abstraction in the API ==