# 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="../reference/data-sources" %}
[data-sources](https://docs.uibakery.io/reference/data-sources)
{% endcontent-ref %}

## Connecting a data source

Check out [this article](https://docs.uibakery.io/build-from-scratch/getting-started/connect-a-data-source) 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="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FDiSWlyVKKmFMcZi68tCy%2FCleanShot%202024-12-17%20at%2011.03.23%402x-min.png?alt=media&#x26;token=47794c6b-a947-406c-8eca-e40360f28312" alt=""><figcaption></figcaption></figure>

Refer to [this section](https://docs.uibakery.io/reference/security/apps-security#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="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2F0PwO4SGD5fu4vvd8DNWB%2FCleanShot%202024-12-17%20at%2011.14.04%402x-min.png?alt=media&#x26;token=d504f3b7-3683-4822-97a0-6b545b445107" alt=""><figcaption></figcaption></figure>
