---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/concepts/datamodel/external_data_source.md?version=main
  - https://ydb.tech/docs/ru/concepts/datamodel/external_data_source.md?version=main
sourcePath: en/core/concepts/datamodel/external_data_source.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# External data sources

An external data source is an object in YDB that describes connection parameters to an external data source. For example, in the case of ClickHouse, the external data source describes the network address, login, and password for authentication in the ClickHouse cluster, and in the case of S3 (Object Storage), it describes access credentials and the path to the bucket.

The following example shows how to create an external data source pointing to a ClickHouse cluster:


```yql
CREATE EXTERNAL DATA SOURCE test_data_source WITH (
  SOURCE_TYPE="ClickHouse",
  LOCATION="192.168.1.1:8123",
  DATABASE_NAME="default",
  AUTH_METHOD="BASIC",
  USE_TLS="TRUE",
  LOGIN="login",
  PASSWORD_SECRET_PATH="test_password_path",
  PROTOCOL="NATIVE"
);
```


After creating an external data source, you can read data from the created `EXTERNAL DATA SOURCE` object. The example below illustrates reading data from the `test_table` table in the `default` database in the ClickHouse cluster:


```yql
SELECT * FROM test_data_source.test_table;
```


Using external data sources, you can run [federated queries](https://ydb.tech/docs/en/concepts/query_execution/federated_query/index.md?version=main) for cross-system data analytics tasks.

You can use the following data sources:

<!-- source: en/concepts/query_execution/federated_query/_includes/supported_eds.md -->
- [S3](https://ydb.tech/docs/en/concepts/query_execution/federated_query/s3/external_table.md?version=main)
<!-- endsource: en/concepts/query_execution/federated_query/_includes/supported_eds.md -->

{% cut "Experimental sources data" %}

<!-- source: en/concepts/query_execution/federated_query/_includes/experimental_eds.md -->
- [ClickHouse](https://ydb.tech/docs/en/concepts/query_execution/federated_query/clickhouse.md?version=main)
- [Greenplum](https://ydb.tech/docs/en/concepts/query_execution/federated_query/greenplum.md?version=main)
- [Microsoft SQL Server](https://ydb.tech/docs/en/concepts/query_execution/federated_query/ms_sql_server.md?version=main)
- [MySQL](https://ydb.tech/docs/en/concepts/query_execution/federated_query/mysql.md?version=main)
- [PostgreSQL](https://ydb.tech/docs/en/concepts/query_execution/federated_query/postgresql.md?version=main)
- [YDB (federated queries between YDB databases)](https://ydb.tech/docs/en/concepts/query_execution/federated_query/ydb.md?version=main)
<!-- endsource: en/concepts/query_execution/federated_query/_includes/experimental_eds.md -->

{% endcut %}
