# Data sources

Connecting your data source is an essential step in building your application. UI Bakery allows connecting to a database or any API:

* **databases** (MySQL, PostgreSQL, etc.);
* **external APIs** (Google Sheets, Firebase, etc.);
* **internal APIs**

Data sources in UI Bakery are **global**, meaning that once set up each data source can be used across different applications. If needed, you can manage data sources' [*access permissions*](#managing-data-source-access) for different user roles.

## UI Bakery data sources

You can find the full list of all data sources available here :point\_down:

{% content-ref url="/pages/YK4OawsjmK4IGfLKY0dI" %}
[List of Data sources](/reference/data-sources.md)
{% endcontent-ref %}

## Connecting a data source

Check out [this article](/build-from-scratch/getting-started/connect-a-data-source.md) and follow the step-by-step instruction to connect a **new** data source.

## Managing data source access

By default, *Admins* and *Editors* of your workspace have all the permissions needed to manage data sources - they can *add new* data sources, *edit* and *remove* existing ones. \
Workspace members with a **User** role have a **Read-only** permission to all data sources. However, you can still manage access to data sources for Users with a *custom role*.

### **To manage user access to data sources:**

1. On the *Data sources* page, click **Manage access settings**.
2. On the page that opens, click the *pencil* icon next to the role you want to edit.
3. Navigate to the *Data sources* tab and select the data sources which you want to grant access to - **Use** and/or **Edit** them.
4. Next, click **Update role**.

{% hint style="danger" %}
By default, all newly created data sources are available only to the **same roles** which the user who created them has.

If you need to, you can also restrict access to data sources - simply clear the **Use** checkbox for a specific role.
{% endhint %}

{% @arcade/embed flowId="ZyTARyNXbytsDoVQyN1B" url="<https://app.arcade.software/share/ZyTARyNXbytsDoVQyN1B>" %}

## Enabling anonymous access

By default, access to data sources is restricted and managed via roles and permissions. If you have a public app, you can enable **anonymous access** to your data source, but you should be cautious since it will allow any user to query your data.

You can enable/disable anonymous access in the **Data source settings**.

<figure><img src="/files/LCJrFtx7gxMdA7c5PM2A" alt=""><figcaption></figcaption></figure>

Refer to [this section](/reference/security/apps-security.md#managing-anonymous-access-in-public-applications) to learn more details on how to safely manage anonymous access.

## Whitelisting IP addresses

To be able to connect to your data source in the cloud version, you need to whitelist our IP addresses:

```
52.176.109.125
20.52.252.203
```

This process may differ depending on the database. Below you can find whitelisting instructions to a couple of databases:

* [MySQL](https://support.rackspace.com/how-to/mysql-connect-to-your-database-remotely/)
* [PostgreSQL](https://blog.devart.com/configure-postgresql-to-allow-remote-connection.html) (with `.conf` files)
* [MongoDB](https://docs.atlas.mongodb.com/security/ip-access-list/#whitelist)

## Selecting data source outbound region

By default, when UI Bakery proxies data from your database to the end user, it passes through UI Bakery servers located in central US. This may cause performance degradation if both the user and the final data source are located in other regions.

To enhance performance and reduce data load time, you need to set the **Outbound region** that is closer to both the data source and the user in the **Data source settings**. It will ensure data flowing directly from the source to the user interface.

<figure><img src="/files/sFK6qpQiD2H8ttuUiK4o" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.uibakery.io/concepts/data-sources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
