Manage data by tenant or knowledge base

Updated at:

In Alibaba Cloud Elasticsearch Agent Engine Edition, Collection and Slice together support large numbers of tenants, knowledge bases, and code repositories, and they keep scaling horizontally as those business spaces grow. Applications access data through a single Collection entry point, and each Slice represents one business space, so you do not need to create and maintain a separate index for each tenant.

As business spaces grow, the system allocates new Slices to available backing indexes (Backings). After a Backing reaches its allocation threshold, the system moves on to other Backings or creates new ones, so that more shards carry new Slices. At the Collection level, business scale is no longer limited by the preset number of shards in a single index, and applications keep using the original Collection name and Slice access method. This scaling applies to the Collection as a whole. A single Slice still uses the shard configuration of the Backing where it resides, and existing Slices are not automatically split or migrated when the system creates a new Backing.

Agent Engine Edition is built on a stateless architecture. Persistent storage grows with your data volume and is billed based on actual usage, and write and query resources scale separately. Data scale, tenant count, and access load can then grow at their own pace.

Basic terms

Term

Meaning

Example

Collection

The data set that applications use as the entry point to access data. A Collection defines field types (Mapping) and index settings (Settings) in one place.

knowledge-chunks stores the knowledge base content of every tenant.

Slice

A data partition within a Collection, divided along business lines and selected through _slice. Each Slice represents one business space, such as a tenant, a knowledge base, or a code repository.

tenant-a contains only the documents of tenant A.

backing index (Backing)

The Elasticsearch index where the system actually stores documents. A Backing can carry multiple Slices. The system handles allocation, and applications access data through Collection and Slice.

The Backings of the knowledge-chunks Collection carry the Slices of every tenant.

Important

A Slice is not an account permission boundary. Tenant authentication remains the responsibility of your application or the security mechanisms that Agent Engine Edition supports. Before you finalize a multi-tenant design, review the Agent Engine Edition Limits and Collection permissions topics linked in Next steps.

Slices in the same Collection share the Mapping but manage their own documents: tenant-a and tenant-b can use the same document ID without overwriting each other. Store both the Slice name and the document ID in your application.

Choose the data scope for your business

Choose the data scope mode that matches how your application identifies the data a query needs. When your application already knows the tenant, knowledge base, or repository identifier before the query runs, it selects one or more Slices through _slice. This approach is called the namespace mode (exact). For a complete example that shows where to set exact, see Getting Started: Search by Tenant or Knowledge Base.

Use the Vector cluster recall when your vectors are already clustered offline and the query must select candidate clusters automatically from the query vector. Set the number of candidate Slices for vector cluster recall based on both the recall rate and the query cost. Both modes support Sliced DiskBBQ to run vector retrieval inside the selected Slices. For more information, see DiskBBQ and Sliced DiskBBQ vector retrieval.

Prepare Backings before you onboard tenants in bulk

Backings are created on demand by default. Before you register tenants or import data in bulk, pre-create several Backings, and then register Slices and import business documents. Pre-creation shortens the wait for index creation on the first write and spreads the data of new Slices across multiple Backings, which helps distribute the read and write load. It does not redistribute existing data or add compute nodes. The actual load still depends on the data volume and access frequency of each Slice, so base the number of Backings you pre-create on those two factors.

For request parameters, the allocation threshold and allocation policy changes, responses, and retry rules, see Pre-create Backings.

Horizontal scaling applies to a Collection as a whole, not to an individual Slice. For capacity parameters and the scope in which they take effect, see How capacity parameters take effect.

Control query scope and cost

When you query by tenant or knowledge base, accessing only the target Slice reduces the reads and computation on data in other Slices. Even as new tenants keep joining the Collection, a single query stays focused on the data of the current tenant instead of expanding to the entire Collection.

Keyword and full-text index queries skip irrelevant data through sliced postings, a mechanism that is enabled by default. Vector retrieval narrows the access scope through Sliced DiskBBQ. Both mechanisms reduce the reads and computation spent on irrelevant data and suit access patterns with many Slices where each query touches only a few of them.

Keep regular queries within one or a few Slices. A full query expands to the entire Collection instead of a target Slice, and its cost grows with the number of Backings and shards. Full queries therefore suit analysis tasks that have a clear scope and load budget.

Next steps