---
title: "Scaling and configuring the xDB Collection database"
slug: "scaling-and-configuring-the-xdb-collection-database"
abstract: "An overview of scaling and configuring the xDB Collection database."
---
# Scaling and configuring the xDB Collection database

The xDB Collection database stores all contact and interaction data, and can experience high write rates from sources such as the [Content Delivery role](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/scaling-and-configuring-content-delivery.html "Scaling and configuring Content Delivery"). Review scaling options and performance tuning tasks for the following roles before scaling the xDB Collection database:

- [Scaling and configuring the xConnect Collection Search role](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/scaling-and-configuring-the-xconnect-collection-search-role.html "Scaling and configuring the xConnect Collection Search role")
- [Scaling and configuring the xConnect Collection service role](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/scaling-and-configuring-the-xconnect-collection-service-role.html "Scaling and configuring the xConnect Collection service role")
- [Scaling and configuring the xConnect Search Indexer](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/scaling-and-configuring-the-xconnect-search-indexer.html "Scaling and configuring the xConnect Search Indexer")

## Scaling and configuring the xDB Collection SQL provider

The xDB Collection SQL provider includes:

- A shard map manager database that stores global information about the shard set.
- A shard set.

The xDB Collection SQL provider supports the following scaling options:

- Sharding. All [default topologies](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/default-topologies.html "Default topologies") include two shards by default, and you [can re-deploy the xDB Collection database with a maximum of 18 shards](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/deploy-the-xdb-collection-database.html "Deploy the xDB Collection database"). Be aware that:
    - Contact and interaction data is sharded by contact ID.
    - The identifiers index is sharded by identifier.
    - Device profiles are sharded by device profile ID.
- In Sitecore 9.3 and later, you can [split/merge shards](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/split-or-merge-xdb-collection-database-shards.html "Split or merge xDB Collection database shards") to redistribute data.
- [Configure Always On for high availability (HA).](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/walkthrough--configuring-always-on-for-the-xdb-collection-database.html "Walkthrough: Configuring Always On for the xDB Collection database")

### Connection string settings replication to xDB Collection shards

The SQL Provider is responsible for creating connections to the xDB Collection shards at runtime. When the SQL Provider opens connections to the Collection shards, it leverages a [connection pooling](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-connection-pooling) technique to minimize the cost of opening connections. When a [Max Pool Size](https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnectionstringbuilder.maxpoolsize?view=dotnet-plat-ext-3.1) key value is included in the `"collection"` connection string, the setting is replicated and applied to connections to the database shards.

The only connection string that is configurable for the Collection database shard cluster is the connection to the shard map manager itself, which is defined in the `<xconnect-root>\App_Config\ConnectionStrings.config` file.

The following shows an example of the `"collection"` connection string configuration with the `max pool size` set to 200:

```xml
<connectionStrings configBuilders="SitecoreConnectionStringsBuilder">
  <add name="collection" connectionString="user id=host_collectionuser>;password=123;data source=.;Initial Catalog=host_Xdb.Collection.ShardMapManager;Max Pool Size=200"/>
</connectionStrings>

```