弹性数据库工具常见问题解答 (FAQ)Elastic database tools frequently asked questions (FAQ)

如果我的分片只有单个租户并且我没有分片键,该如何为架构信息填充分片键If I have a single-tenant per shard and no sharding key, how do I populate the sharding key for the schema info

架构信息对象仅用于“拆分/合并”方案。The schema info object is only used to split merge scenarios. 如果某个应用程序本质上是单租户,那么它则不需要“拆分/合并”工具,因此无需填充架构信息对象。If an application is inherently single-tenant, then it does not require the Split Merge tool and thus there is no need to populate the schema info object.

在已预配了一个数据库,并且已安装了分片映射管理器的情况下,应如何将此新数据库注册为分片?I've provisioned a database and I already have a Shard Map Manager, how do I register this new database as a shard

请参阅使用弹性数据库客户端库将分片添加到应用程序Please see Adding a shard to an application using the elastic database client library.

弹性数据库工具的费用如何How much do elastic database tools cost

使用弹性数据库客户端库不会产生任何费用。Using the elastic database client library does not incur any costs. 只有为分片使用的 Azure SQL 数据库和分片映射管理器,以及为“拆分/合并”工具预配的 Web/辅助角色才会产生费用。Costs accrue only for the Azure SQL databases that you use for shards and the Shard Map Manager, as well as the web/worker roles you provision for the Split Merge tool.

为什么当我从另一台服务器添加分片时,我的凭据不起作用Why are my credentials not working when I add a shard from a different server

请勿使用“用户 ID=username@servername”形式的凭据,而只需使用“用户 ID = username”。Do not use credentials in the form of "User ID=username@servername", instead simply use "User ID = username". 此外,请确保“用户名”登录名对分片具有权限。Also, be sure that the "username" login has permissions on the shard.

是否我每次启动应用程序时,都需要创建分片映射管理器并填充分片Do I need to create a Shard Map Manager and populate shards every time I start my applications

否 - 分片映射管理器(例如,ShardMapManagerFactory.CreateSqlShardMapManager)只需创建一次。No-the creation of the Shard Map Manager (for example, ShardMapManagerFactory.CreateSqlShardMapManager) is a one-time operation. 在启动应用程序时,应用程序应使用调用 ShardMapManagerFactory.TryGetSqlShardMapManager()Your application should use the call ShardMapManagerFactory.TryGetSqlShardMapManager() at application start-up time. 每个应用程序域应该只有一个此类调用。There should only one such call per application domain.

我在使用弹性数据库工具方面存在疑问,如何才能获得解答I have questions about using elastic database tools, how do I get them answered

请在 Azure SQL 数据库论坛上联系我们。Please reach out to us on the Azure SQL Database forum.

当使用分片键建立数据库连接的同时,仍然可以对同一分片上的其他分片键查询数据。When I get a database connection using a sharding key, I can still query data for other sharding keys on the same shard. 这是设计使然吗Is this by design

弹性缩放 API 使用户能够连接到分片键的正确数据库,但不提供分片键筛选。The Elastic Scale APIs give you a connection to the correct database for your sharding key, but do not provide sharding key filtering. 如果需要,请在查询中添加 WHERE 子句,以将范围限制到提供的分片键。Add WHERE clauses to your query to restrict the scope to the provided sharding key, if necessary.

是否可对分片集中的每个分片使用不同的 SQL 数据库版本?Can I use a different SQL Database edition for each shard in my shard set

是的,每个分片是单独的数据库,因此,一个分片可以是高级版,而另一个可以是标准版。Yes, a shard is an individual database, and thus one shard could be a Premium edition while another be a Standard edition. 此外,在分片的生命周期内,该分片的版本可以进行多次上调或下调。Further, the edition of a shard can scale up or down multiple times during the lifetime of the shard.

在拆分或合并操作期间,“拆分/合并”工具是否会设置(或删除)数据库Does the Split Merge tool provision (or delete) a database during a split or merge operation

否。No. 对于 拆分 操作,必须存在目标数据库和相应的架构,并且必须注册到分片映射管理器。For split operations, the target database must exist with the appropriate schema and be registered with the Shard Map Manager. 对于 合并 操作,必须从分片映射管理器中删除分片,并删除数据库。For merge operations, you must delete the shard from the shard map manager and then delete the database.

其他资源Additional resources

尚未使用弹性数据库工具?Not using elastic database tools yet? 请查看入门指南Check out our Getting Started Guide.