The Wayback Machine - https://web.archive.org/web/20240809174351/https://www.geeksforgeeks.org/data-access-layer/
Open In App

Data-Access Layer

Last Updated : 24 Jan, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

In this article, we are going to learn about the Business Logic Layer in Database Management systems. A DBMS usually consists of various layers where each one has a specific kind of task it performs. The main purpose of the layered structure is to implement abstraction in Database systems. Change in one schema must not affect the other schema. This architecture allows the Database Administrator to design the schema and implement methods to allow secured access to the stored data.

The Data-Access Layer (DAL) is a component of a software architecture that is responsible for managing the data storage and retrieval of an application. It sits between the business-logic layer and the data storage system and provides an abstraction layer that allows the business-logic layer to interact with the data storage system without being aware of its specific implementation.

The DAL is responsible for performing tasks such as:
-Connecting to the data storage system and managing the connection.
-Generating and executing SQL queries or other data access commands to retrieve and store data.
-Mapping the data from the data storage system to the application’s data objects and vice versa.
-Handling errors and exceptions related to data access.
-Providing support for transactions and other data access features.

The DAL is designed to be reusable and independent of the business logic and data storage implementation. This allows the application to be easily modified or extended without affecting the underlying data access code.

The DAL can be implemented using different data access technologies, such as ADO.NET, JDBC, or ORM (Object-relational mapping) libraries. The choice of technology will depend on the specific requirements of the application and the data storage system being used.

In summary, The Data-Access Layer (DAL) is a component of a software architecture that is responsible for managing the data storage and retrieval of an application. It sits between the business-logic layer and the data storage system and provides an abstraction layer that allows the business-logic layer to interact with the data storage system without being aware of its specific implementation. The DAL is designed to be reusable and independent of the business logic and data storage implementation. It can be implemented using different data access technologies and it provides support for transactions and other data access features.

Data-Access Layer (DAL) 

Data-Access Layer is a layer in an application that provides easy and simplified access to data stored in persistent storage, such as an entity-relational database or any database for that matter. It is layer that exists between the Business Logic Layer (BLL) and the storage layer. 

Let us understand some terminologies involved: 

1. Data-Access Object (DAO): They are entities that are collectively known as the Data Access Layer (DAL). A DAL might be a single class, or it might be composed of multiple Data Access Objects (DAOs). 

2. Business Logic Layer: The business logic layer consists of all the objects and functionalities which handle the business logic of the application, this is where the main implementation of an application takes place and it is very unique for each application. 

3. Storage Layer: The actual database where data is stored, upon which CRUD operations can be performed. This might be some remote or cloud storage.

 

Data Access Layer

Data Access Layer

Whenever a specific data query or update is required by the Application (BLL), the request is sent to the Data Access Layer, which then takes appropriate actions to ensure that the requested data or updation is performed, this results in a level of abstraction wherein the Business Layer will only know which function or methods to call, and it does not have to know the actual architecture or details of the entire Database.
 

Purpose/Importance of having a DAL:

  • Provides a centralized location from where calls are made onto the database(s).
  • Provides a layer of abstraction as a developer working on the Business Logic need not worry about the way in which data is stored or their CRUD operations.
  • A Data-Access Layer (DAL) can support multiple databases, so the application is able to make use of any database as per its requirement.
  • Because segregating the data access code, enables better maintainability and easy migration of the database.

Example: 

Let us assume an airline ticket reservation system, when a user attempts to view the flight availability from the front-end, the business logic layer will send the query request to the Data-Access Layer, from here its this layer’s job to interact with the storage and obtain the queried results. The Business logic layer is not concerned with the way in which data is represented in the storage, whether it is relational or non-relational types. It is the job of the DAL to retrieve the required data from one or more locations from the storage(s) and send it back to the Business Logic Layer, which is converted to user-understandable format, then sent to the front-end.



Similar Reads

Data Link Layer in OSI Model
Below are some common GATE CS topics of data link layer. Carrier Sense Multiple Access (CSMA) Carrier Sense Multiple Access or CSMA method was developed to minimize the probability of collision and thus, to increase the performance. The probability of collision can be minimized if a station senses or reads the medium before trying to use it for sen
3 min read
Business-Logic Layer
In this article, we are going to learn about the Business Logic Layer in Database Management systems. The Business Logic Layer also known as BLL act as an intermediate between the Presentation Layer and the Data Access Layer (DAL). This layer handles the business logic, business rules as well as calculations. It tells how the data from the database
4 min read
Different Functionalities of MTP3 Layer
In the field of computer networking, the network management functions are widely used to signal links or restore the failed links, activate the idle links, deactivate the aligned links, also, maintaining the services if the signal links and SPs are lost, forced routing, control routing and signaling the traffic flow control. When it comes to the co
11 min read
Design Issues in Network Layer
The Network layer is majorly focused on getting packets from the source to the destination, routing error handling, and congestion control. Before learning about design issues in the network layer, let's learn about its various functions. Addressing: Maintains the address at the frame header of both source and destination and performs addressing to
5 min read
Spring Boot | How to access database using Spring Data JPA
Spring Data JPA is a method to implement JPA repositories to add the data access layer in applications easily. CRUD stands for create, retrieve, update, delete which are the possible operations which can be performed in a database. In this article, we will see an example of how to access data from a database(MySQL for this article) in a spring boot
4 min read
What is ACCESS EXCLUSIVE LOCK Mode in PostgreySQL?
Locking is a functionality of a relational database to block various kinds of access performed on the tables based on the lock mode. The session which took the lock retains normal access and the effect is only seen by other users trying to access the locked table in another session. When any such attempt is made, database will block the access in t
4 min read
Difference between InfluxDB and Microsoft Access
1. InfluxDB : InfluxDB is a time-series database and is known for its high availability and storage. It was developed by InfluxData in 2013. It is open-source licensed software and is widely used in retrieval of time series data. It is used in real-time analytics and monitoring of data. It does partitioning by sharding. InfluxDB is implemented in G
2 min read
Difference between Microsoft Access and dBASE
1. Microsoft Access : Microsoft Access is a database program, it uses unique ID numbers and an editable list of data to store details on a large amount of items, i.e. you could use this program to store. Access is designed to have multiple users working in the same DB files along with the various safety precautions items to help protect the data su
2 min read
Why User's Access is Prone to Attack?
An application's mechanism for handling user access only as strong as the weakest of these components. Have you ever wondered about the above statement and why user access is considered the weakest component, well if you haven't wondered about this then there is no problem but you must be aware of some important concepts of user access? The defense
6 min read
Chr() and Asc() Function in MS Access
1. CHR() Function : The Chr() function returns the character for the given ASCII number code. The Chr function takes an integer as a parameter and returns the respective character. It works opposite to ASC() function. Syntax - Chr(ASCII number code) Parameter - Required; An integer. Return - A character. Example - SELECT Chr(75) AS NumberCodeToChar
1 min read
Article Tags :
three90RightbarBannerImg