> ## Documentation Index
> Fetch the complete documentation index at: https://docs.explo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Multiple Data Sources

> This guide describes how to configure Explo to support multiple data sources

## Why Multiple Data Sources?

There are a few different reasons why you may want to connect multiple data sources to Explo:

* You want to connect and build dashboards against both your staging and production databases
* You have customer data segmented into multiple different databases

In either of these scenarios, you can use Explo to connect multiple data sources to power your dashboards.

<Note>
  Explo allows you to folder your data sources by schema to configure which
  queries run against which data sources. For more information, navigate to the
  [Managing Schema](/data-sources/data-sources-and-schema/managing-schema)
  section of our documentation.
</Note>

## View Data Sources

To view all connected data sources, navigate to the Data tab.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-1.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=14edac5e9cc53b620b9e18a03e580d36" alt="" width="3504" height="496" data-path="images/data-sources/multiple-data-sources-1.png" />

On this page, you will see all connected data sources. If you click on a
specific data source, you will be taken to a data viewer where you can preview
the data in the data source. This view also allows you to toggle between
different data sources within that schema.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-2.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=f14bd0c15892aee42d1843952473194d" alt="" width="1562" height="541" data-path="images/data-sources/multiple-data-sources-2.png" />

## Add a Data Source

On the Data tab, click the "Add Data Source" button to add a new data source.
First, you'll be prompted to enter a display nickname and id for your database,
along with choosing its schema and visibility group. For more information about
visibility groups, check out
[this section of our documentation](/managing-permissions/visibility-groups).

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-3.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=06af1874b21c5781b390fd525b1809b8" alt="" width="3320" height="274" data-path="images/data-sources/multiple-data-sources-3.png" />

Follow the steps in the flow and enter your credentials for the database to
connect it to Explo.

## Connecting Customers to Data Sources

### Customer API

Every customer you create in Explo is associated with a specific set of data
sources, one for each schema. When you render the dashboard for that customer,
it will pull all data for that view from those data sources associated with the
customer.

When you create a customer via the API, you can optionally specify a
`data_source_id` or the `data_source_provided_id`. This will associate the user
group with that data source for the schema that data source belongs to. If you
do not specify the data source, it will associate the customer with the
default data source, which you can configure from the data page.

For more information, go to
[our section on the Customer API](/api-reference/customer-api).

<Note>
  You can retrieve the data default `data_source_id` by going to the data tab and
  looking at the number ID for the data source (47).
</Note>

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-4.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=6eddbe5a54735647da2248f06f4a6df2" alt="Example data sources with IDs" width="3316" height="316" data-path="images/data-sources/multiple-data-sources-4.png" />

<Note>
  You can assign a `data_source_provided_id` in the data tab which then can be
  used to identify the data source in your API requests:
</Note>

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-5.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=bfb278e16f1a75e933697786117beeee" alt="Selecting to rename the provided_id" width="1164" height="1062" data-path="images/data-sources/multiple-data-sources-5.png" />

### Customers Tab

On the Customers tab, there are dropdowns for choosing a data source for each
schema when editing or creating a customer. If no data source is selected for a
given schema, that customer will be associated with the default data source for
that visibility group and schema.

<img src="https://mintcdn.com/explo/PKkXxOQ4Cq1reQN8/images/data-sources/multiple-data-sources-6.png?fit=max&auto=format&n=PKkXxOQ4Cq1reQN8&q=85&s=c0b1c468a3487dc7602ec528ea5c9ba6" alt="" width="1257" height="285" data-path="images/data-sources/multiple-data-sources-6.png" />

## Viewing Dashboards in Different Data Sources

When you are making dashboards, there is a dropdown for customers.

For each dashboard, you will be able to toggle between different customers to
select which one you are viewing as. the data on the page will then reflect data
from the data sources associated with that customer.

## Embedding with Multiple Data Sources

Embedding with multiple data sources is as straightforward as with a single data
source.

When you create your customers, we will give you back the customer token.
Simply provide this token when embedding and we will query from the right data
sources and present the correct data.
