Skip to content
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

can't set the redis DB number? #2690

Open
trkjoy opened this issue Dec 12, 2022 · 9 comments
Open

can't set the redis DB number? #2690

trkjoy opened this issue Dec 12, 2022 · 9 comments
Labels

Comments

@trkjoy
Copy link

trkjoy commented Dec 12, 2022

Look at the source code, can't set the redis DB number,why to be like this design?
Whether can let go of redis DB Settings?
60231232102544

@yiGmMk
Copy link
Contributor

yiGmMk commented Dec 12, 2022

using pipeline to select db
`
r:=redis.New(xxx)

err = r.Pipelined(func(p redis.Pipeliner) error {
p.Select(1)
return nil
})
`
https://github.com/zeromicro/go-zero/issues?q=redis+db
#715
#368
#652

@smithyj
Copy link
Contributor

smithyj commented Jan 1, 2023

because redis cahce should one service one node

@GuiBin2013
Copy link

as a framework, i think it should provide complete function, not best practice which you think。
because there are more complicated and special scenes and team conditions .

go-zero is a excellent framework, now we use it by changing source code because of this feature, i think this's not a overly feature, can consider it again?

thanks.

@uiosun
Copy link

uiosun commented Mar 16, 2023

because redis cahce should one service one node

One node ≠ One Database!

Redis support Database Number functional, and it real can support more scencs,

@uiosun
Copy link

uiosun commented Mar 16, 2023

Hi @kevwan , many user has different purpose to use Redis.

I readed the #652, but more DevOps work is not good idea -- go-zero support more functional, and like we, the "many redis db" is real required (we hug the mirco service frame work, and only has one redis server).

If some group or some scencs really need "single redis db", set normal formulas is good idea, "cut Redis official functional" is weird.

@callmePicacho
Copy link

using pipeline to select db ` r:=redis.New(xxx)

err = r.Pipelined(func(p redis.Pipeliner) error { p.Select(1) return nil }) ` https://github.com/zeromicro/go-zero/issues?q=redis+db #715 #368 #652

底层 v8 使用连接池,这个被 select 的连接不确定什么时候回收,新建的每个连接都需要 select

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Sep 27, 2024
@gzlboy
Copy link

gzlboy commented Nov 24, 2024

社区这个需求很大,作为框架是应该替使用者考虑各种场景的,最佳实践一个项目一个redis没错,那redis为何要搞多database供开发者选择?不外乎适应开发者更复杂、更个性的使用场景嘛,框架有,开发者用不用是他们的事,用出问题也是他们的事对吧。

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


There is a huge demand from the community. As a framework, it should consider various scenarios for users. The best practice is to have one redis per project. So why does redis have multiple databases for developers to choose from? It's nothing more than adapting to developers' more complex and personalized usage scenarios. There is a framework, and it's up to the developers whether they use it or not. It's also their business if problems arise after using it, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants