---
title: "Configure Data Sources"
canonical: "https://support.appfire.com/space/SQL/74318908/Configure%20Data%20Sources"
format: markdown
---
> Macro (aura-html)

# Overview

:info: At least one Data Source or Data Source Profile needs to be configured before you can use the [SQL Macro](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74322843) or [SQL-query Macro](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74322852) or [SQL-file](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74323096/SQL-file+-+9.x).

This page describes two methods to configure Data Sources for the macros provided by [SQL for Confluence](https://bobswift.atlassian.net/wiki/spaces/SQL). SQL Macros use Data Sources to access databases. A Data Source defines the access parameters including credentials. The same database access information is required for each method. Similarly, the database must allow access using the information provided no matter which method is used.

| **Method** | **Primary Benefit** | **Key Attributes** | **Documentation** | **Express Edition** | **Pro Edition** |
| --- | --- | --- | --- | --- | --- |
| Data Source Profiles | Convenience | - SQL for Confluence specific configuration
- Convenience
  - Configuration change in affect immediately
  - File system access not needed
- Can reference application server defined Data Sources
- Recommended for evaluation, testing, short term scenarios
- Medium or heavier use scenarios should also employ [Cache for Confluence](https://appfire.atlassian.net/wiki/spaces/CACHE/overview) | [Configure Data Source Profiles](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74323164) | :check_mark: | :check_mark: |
| Application Server-based Data Source | Performance | - Application server based configuration
- Best performance via connection pooling/reuse
- Requires Confluence restart after configuration change
- Recommended for long term/heavy use scenarios | [Configure application server-based data sources - 9.x](https://appfire.atlassian.net/wiki/spaces/SQL/pages/74323198) | :cross_mark: | :check_mark: |

> ✅ <span style="color: #333333">You can configure data sources using either of the methods or both - for instance use a data source profile while testing or for low-use scenarios,</span><span style="color: #333333"> then switch to a server-based data source when/if it becomes clear it is going to be around for a long while.</span>

> ✅ **Macro Security for data source access control**
> ✅ 
> ✅ [Macro Security for Confluence](https://appfire.atlassian.net/wiki/display/CMSP) can be used to control access to specific Data Sources in the same way no matter what method is used.

> ✅ **Use Cache and Future macros around SQL macros**
> ✅ 
> ✅ Give your users better response times and reduce the load on your server by using [Cache for Confluence](https://appfire.atlassian.net/wiki/spaces/CACHE/overview) macros for heavy use scenarios.

The Data Source is referenced using the **dataSource** (Data Source name) parameter. The exact configuration of a Data Source is application server and database specific. The configuration must be done by a Confluence administrator and the Confluence application server must be restarted for changes to be active. The configuration must be done very carefully as any errors result in the Data Source being unusable 🙁. Each database you need to access in Confluence needs to a have a Data Source configuration.

![image](media://5d367bb4-2674-4595-a588-b4532ff09481)