A data source, in the context of computer science and computer applications, is the location where data that is being used come from. In a database management system, the primary data source is the database, which can be located in a disk or a remote server. The data source for a computer program can be a file, a data sheet, a spreadsheet, an XML file or even hard-coded data within the program.
Data sources can differ according to the application or the field in question. Computer applications can have multiple data sources defined, depending on their purpose or function. Applications such as relational database management systems and even websites use databases as primary data sources. Hardware such as input devices and sensors use the environment as the primary data source. A good example is a temperature and pressure control system for a fluid circulation system such as the ones used in factories and oil refineries, which take all related data from the environment or whatever they are monitoring; so the data source here is the environment. Data such as temperature and pressure of the fluid are taken by sensors regularly and then stored in a database, which then becomes the primary data source for another computer application that manipulates and presents this data.
A data source is most commonly used in context with databases and database management systems or any system that primarily deals with data, and is referred to as a data source name (DSN), which is defined in the application so that it can find the location of the data. It simply means what the words mean: where data is coming from.