-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple DB support and "SELECT" command support #61
Comments
I would also like to use many databases in one instance. |
The default, and only, database in Garnet at the moment is 0 (zero). |
Yes, I am testing whether replacing Redis is feasible, Found no difference between GetDatabase (0) and GetDatabase (6) The key: value written in db0 can be read and overwritten in db6, which will affect the original business |
Is this intentionally designed to ensure the excellent performance of "garnet"? |
我有一个想法不知道当讲不当讲。算了先讲了吧。我英语不太行。直接写中文了,要是有大佬能看懂的话。能不能请大佬帮忙翻译一下。 先说目的: 下面说方案: 2、当某个会话调用 SELECT命令时,正常返回OK。前记录下应该会话前最后一次调用SELECT 时的DB_ID。当然这里可以做一个突破。我们可以允许使用 非数字ID 3、既然我们的会话中已经保存了 DB_ID。那么为了模拟出多DB的效果。在使用所有与key相关的命令时, 默认给 输入的key 加上前缀 "{DB_ID}:",懂的都懂。这样就能保证不同的DB_ID中的内容不会相互覆盖。 这样一来,虽然 所有内容都保存在同一个DB中。但都被 前缀进行了区分。也就完成了对 redis 多DB的模拟。对之前使用redis 项目也能进行良好的兼容。 |
代码部分在我自己仓库的分支上,这是提交记录: |
不知道这样做,可行不?会不会有什么问题? |
你这样做有考虑过Key就是按这种命名方式的情况吗, 直接麻了 |
你只考虑了自己的情况, 实际情况用Key模拟区分DBIndex指定是不行的. Key就是Key不是space |
Can multiple DB support and "SELECT" command support be added. If you want to replace Redis, it is difficult to achieve without multi DB support. If supported, replacing Redis would be much more convenient.
The text was updated successfully, but these errors were encountered: