Best Practices for Access Isolation Between Different Business Data in Scenarios Using TiKV Alone

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 单独使用 TiKV 场景下,不同业务数据之间的访问隔离问题的最佳实践

| username: ethanlee

For example, when using a relational database, you can create different tables to store different business data. When accessing data, you must specify the table name, which allows for a certain degree of access isolation. Is there a similar concept in TiKV?

One relatively easy way to achieve this is by adding a prefix to the key for different businesses (for example, using “users:” as the prefix for user-related business keys).

Are there any better solutions? Keyspace?

| username: ethanlee | Original post link

Especially now that the project uses the DeleteRange feature, I’m quite worried that if the startKey or endKey is set incorrectly, it might accidentally delete data from other services.

| username: dba-kit | Original post link

You can look into the relevant knowledge about Placement Rules. However, it is more convenient to use it in conjunction with TiDB. If you only have TiKV, I’m not sure if it can be set up.

| username: dba-kit | Original post link

Here is how to perform resource isolation when creating tables through TiDB: Placement Rules in SQL | PingCAP 文档中心

| username: dba-kit | Original post link

It looks like you can set start_key and end_key.

| username: ethanlee | Original post link

@zz-jason @Night-NULL

| username: ethanlee | Original post link

Currently, it seems that TIKV cannot set this.

| username: ethanlee | Original post link

@zz-jason Can I ask when the key space feature for TiKV is expected to be released?

| username: Kongdom | Original post link

:thinking: The last reply was in 2022~