Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 单独使用 TiKV 场景下,不同业务数据之间的访问隔离问题的最佳实践
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?
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.
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.
Here is how to perform resource isolation when creating tables through TiDB: Placement Rules in SQL | PingCAP 文档中心
It looks like you can set start_key and end_key.
Currently, it seems that TIKV cannot set this.
@zz-jason Can I ask when the key space feature for TiKV is expected to be released?
The last reply was in 2022~