Skip to content

Add Redis database number to settings#95

Closed
anpryl wants to merge 13 commits intoenvoyproxy:masterfrom
anpryl:redis_db_number
Closed

Add Redis database number to settings#95
anpryl wants to merge 13 commits intoenvoyproxy:masterfrom
anpryl:redis_db_number

Conversation

@anpryl
Copy link
Copy Markdown

@anpryl anpryl commented Aug 16, 2019

@lyft/network-team add ability to pass Redis database number to ratelimit

@stale
Copy link
Copy Markdown

stale bot commented Aug 23, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Aug 23, 2019
@stale stale bot removed the stale label Aug 23, 2019
@mattklein123
Copy link
Copy Markdown
Member

@junr03 PTAL

@junr03
Copy link
Copy Markdown
Member

junr03 commented Aug 30, 2019

@anpryl what is the use case for this setting?

@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 2, 2019

@junr03 we have single redis instance for multiple applications. Each application uses own database by number.

@stale
Copy link
Copy Markdown

stale bot commented Sep 9, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Sep 9, 2019
@junr03
Copy link
Copy Markdown
Member

junr03 commented Sep 9, 2019

Thanks for the explanation @anpryl. Three high level comments:

  1. We need to add documentation for this feature.
  2. We need to add tests for this feature.
  3. I would like to work to make this feature use a new NewPool method like @repl-david-winiarski did in Redis TLS and Auth support #96. It would be ideal if we don't change the "legacy" plain method. This way we have a precedent for acquiring different types of pools from the driver.

@stale stale bot removed the stale label Sep 9, 2019
@junr03 junr03 mentioned this pull request Sep 9, 2019
@stale
Copy link
Copy Markdown

stale bot commented Sep 16, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Sep 16, 2019
@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 16, 2019

Working on it

@stale stale bot removed the stale label Sep 16, 2019
@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 16, 2019

@junr03

I would like to work to make this feature use a new NewPool method like @repl-david-winiarski did in #96. It would be ideal if we don't change the "legacy" plain method. This way we have a precedent for acquiring different types of pools from the driver.

I'm not sure that I understand you correctly.
Do you propose to add new function like NewPoolImplWithDatabaseNumber instead of extending an existing one?
I think that the database number is very generic connection parameter. Both TLS and non-TLS functions could accept it. In other case we need two version of non-TLS NewPool and two versions for TLS NewPool.
Could you please explain why do we need separate function to accept database number?

@anpryl anpryl changed the title Add Redis database number to settings [WIP] Add Redis database number to settings Sep 16, 2019
@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 16, 2019

@junr03 I reworked NewPoolImpl to accept a list of functions to configure redis client. Also, I add WithDatabase to configure the database number.
Also, it will be easier to extend the connection configuration (for example: TLS).

Working on tests.

@anpryl anpryl changed the title [WIP] Add Redis database number to settings Add Redis database number to settings Sep 17, 2019
@junr03
Copy link
Copy Markdown
Member

junr03 commented Sep 18, 2019

@HenryYYang for a second pair of eyes.

@stale
Copy link
Copy Markdown

stale bot commented Sep 25, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Sep 25, 2019
@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 26, 2019

bump to remove stale tag

@stale stale bot removed the stale label Sep 26, 2019
@HenryYYang
Copy link
Copy Markdown

I just realized that this is for ratelimit service which use a local copy of redis. I don't have a lot of context on this. That said, multiple database on a single redis is generally a bad thing with little benefit see this discussion. https://groups.google.com/forum/#!topic/redis-db/vS5wX8X4Cjg/discussion
A better alternative would be to change the key to create logical partition within a single database, or create multiple redis instances.

@anpryl
Copy link
Copy Markdown
Author

anpryl commented Sep 30, 2019

@HenryYYang database numbers is stable redis feature. I believe multiple teams already using it. Why not add support of stable feature?

@stale
Copy link
Copy Markdown

stale bot commented Oct 7, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale label Oct 7, 2019
@stale
Copy link
Copy Markdown

stale bot commented Oct 14, 2019

This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot closed this Oct 14, 2019
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 this pull request may close these issues.

4 participants