Connection Strings Overview
-
A connection string is a named, reusable object that stores the details RavenDB needs to connect to an external system or another RavenDB database, such as destination URLs, the target database or resource, and authentication parameters.
-
RavenDB tasks and features reference a connection string by name.
This keeps connection details outside each task or feature definition and lets the same connection string be reused. -
Connection strings can be defined in one of two scopes:
- Per-database - available only to one database.
- Server-wide - defined once at the cluster level and propagated automatically to databases in the cluster.
What connection strings are used for
Connection strings define the connection details that RavenDB tasks and features use to connect to another system:
- ETL tasks:
Send transformed data from RavenDB to another RavenDB database, a relational database, cloud storage, a search engine, or a queue provider. - External Replication:
Replicate documents to another RavenDB database. - Queue Sink tasks:
Consume messages from a message broker and store the resulting documents in RavenDB. - CDC Sink tasks:
Stream changes from an external CDC database and store the resulting documents in RavenDB. - AI features:
Connect to AI providers used by embeddings generation, GenAI tasks, and AI Agents.
Supported connection string types
RavenDB supports the following connection string types:
| Type | Connects to | Used by |
|---|---|---|
| RavenDB | Another RavenDB database | RavenDB ETL, External Replication, and Hub/Sink Replication |
| SQL | A relational database | SQL ETL and CDC Sink |
| Snowflake | A Snowflake warehouse | Snowflake ETL |
| OLAP | Local or cloud storage | OLAP ETL |
| Elasticsearch | An Elasticsearch cluster | Elasticsearch ETL |
| Queue | A supported queue broker or queue service | Queue ETL and Queue Sink tasks |
| AI | AI providers or RavenDB's embedded model | Embeddings generation, GenAI tasks, and AI Agents |
Scope: per-database and server-wide
A connection string can be defined at one of two scopes:
| Scope | Use when | Availability |
|---|---|---|
| Per-database | One database needs its own connection details, or different databases need different credentials, endpoints, or providers. | Stored in one database record and available only to tasks in that database. |
| Server-wide | Many databases share the same connection details, and you want one place to update endpoints, credentials, or provider settings. | Stored at the cluster level and propagated to all databases, except databases that are explicitly excluded. |
Managing connection strings
Connection strings can be created, updated, read, and removed from Studio or through the Client API.
-
Per-database connection strings
Manage them from the database's Settings > Connection Strings view in Studio, or via the Client API.
Learn more in: -
Server-wide connection strings
Manage them from Manage Server > Server-Wide Connection Strings in Studio, or via the Client API.
Learn more in:
A connection string cannot be deleted while it is still referenced by a task.