What’s a data access layer?

Print anything with Printful



The data access layer (DAL) is a part of a computer program that facilitates access between the program and permanent storage. It acts as an intermediary between the program and storage device, shuffling information back and forth. Programs that use a data access layer can be dependent or database agnostic.

A data access layer (DAL) is a specific part of every computer program that facilitates access between the program and any type of permanent storage. Programs are all applications running on your computer; permanent storage refers to any permanent storage locations on your computer, such as hard drives. While running, programs are constantly writing and reading information to and from the hard drive. The function of the data access layer is to ensure that any program running on the system is able to get the information it needs as soon as it needs it.

Like an intermediary or supplier in a business relationship, the data access layer is between the program and the storage device. Every program running on your computer that needs to access information on your hard drive has working data access layers. Instead of the main body of the program communicating directly with the persistent storage location, it delegates responsibility to the data access layer, which then acts on behalf of the program to accomplish the task. Its only “job” is to shuffle information back and forth, freeing up the rest of the program to fulfill its other responsibilities.

A typical example of a working data access layer involves a program that requires external information to function; in other words, information that the program does not intuitively possess. For example, if a program is trying to calculate changes in a company’s profit margin over the past 10 years, it is unlikely that such information will be present within the actual program. However, it will exist within a database of company financial records. When the program realizes that it requests “Cash Flow Statement X” or “Earnings Report Y”, it instructs the Data Access Layer to find that information. The data access layer then pulls the necessary information from the appropriate database or table, feeding it back to the program so it can continue to run.

Some programs that use a data access layer depend on the database; this means they are designed to work with a specific database type, limiting their portability. Others are database agnostic, giving you the ability to work with a wider range of database software. While it may seem that dependent data access layer programs are less useful, this is not necessarily the case. Because they are designed to work with one type of database, they are likely to be tuned more efficiently, providing faster performance while working with the intended type of database system.




Protect your devices with Threat Protection by NordVPN


Skip to content