Content deleted Content added
Wikipedia is not a reliable source, refine ref details |
ME |
||
Line 1:
{{More citations needed|date=September 2014}}
A '''database abstraction layer''' ('''DBAL'''<ref>{{cite book|author1=Tim Ambler|author2=Nicholas Cloud|title=JavaScript Frameworks for Modern Web Dev|url=https://books.google.com/books?id=2IfDCgAAQBAJ&pg=PA346|year=2015|publisher=Apress|isbn=978-1-4842-0662-1|page=346}}</ref> or '''DAL''') is an [[application programming interface]] which unifies the communication between a computer application and [[database]]s such as [[MSSQL|SQL Server]], [[IBM DB2|DB2]], [[MySQL]], [[PostgreSQL]], [[Oracle database|Oracle]] or [[SQLite]]. Traditionally, all database vendors provide their own interface tailored to their products, which leaves it to the application programmer to implement code for all database interfaces he or she would like to support. Database abstraction layers reduce the amount of work by providing a consistent API to the developer and hide the database specifics behind this interface as much as possible. There exist many abstraction layers with different interfaces in numerous programming languages. If an application has such a layer built in, it is called '''database-agnostic'''.<ref>http://searchdatamanagement.techtarget.com/definition/database-agnostic</ref>
== Database levels of abstraction ==
=== Physical level (lowest level) ===
The lowest level connects to the database and performs the actual operations required by the users.
Implementation of the physical layer may use database
Implementation of data types and operations are the most database
=== 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 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.
Line 23:
== Database abstraction in the API ==
Libraries unify access to databases by providing a single low-level programming interface to the application developer. Their advantages are most often speed and flexibility because they are not tied to a specific [[query language]] (subset) and only have to implement a thin layer to reach their goal. As all [[SQL]] dialects are similar to one another, application developers can use all the language features, possibly providing configurable elements for
Popular use for database abstraction layers are among [[object-oriented programming]] languages, which are similar to API-level abstraction layers. In an object-oriented language like C++ or Java, a database can be represented through an [[Object (computer science)|object]], whose methods and members (or the equivalent thereof in other programming languages) represent various functionalities of the database. They also share advantages and disadvantages with API-level interfaces.
== Language-level abstraction ==
An example of a database abstraction layer on the language level would be [[ODBC]]
Alternatively, there are thin wrappers, often described as ''lightweight'' abstraction layers, such as OpenDBX<ref>{{cite web |url=https://www.linuxnetworks.de/doc/index.php?title=OpenDBX |title=OpenDBX |author==<!--Not stated--> |date=24 June 2012 |website=linuxnetworks.de |access-date=26 July 2018}}</ref> and libzdb.<ref>{{cite web |url=http://www.tildeslash.com/libzdb/ |title=Libzdb |author==<!--Not stated--> |access-date=26 July 2018 |year=2018 |website=tildeslash.com}}</ref> Finally, large projects may develop their own libraries, such as, for example, libgda<ref>{{cite web |url=http://www.gnome-db.org/ |title=GNOME-DB |author==<!--Not stated--> |access-date=26 July 2018 |date=12 June 2015 |quote=Libgda library [...] is mainly a database and data abstraction layer, and includes a GTK+ based UI extension, and some graphical tools.}}</ref> for [[GNOME]].
Line 47:
=== Added Database Features ===
Depending on the database and the DAL, it may be possible for the DAL to add features to the database.
== Arguments against ==
Line 58:
=== Masked operations ===
Database abstraction layers may limit the number of available database operations to a subset of those supported by the supported database backends.
== See also ==
|