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

redisの役割について #1878

Closed
shin1kt opened this issue May 16, 2024 · 5 comments
Closed

redisの役割について #1878

shin1kt opened this issue May 16, 2024 · 5 comments

Comments

@shin1kt
Copy link

shin1kt commented May 16, 2024

@nabeta
初歩的な質問ですみません。enjuをGCP上に構築したいと思っており、各コンテナの役割を調べているのですが、redisは、どのようなことに使用していますか?
具体的には、Memorystore for Redis で代用ができるか検討しております。

@nabeta
Copy link
Member

nabeta commented May 19, 2024

@shin1kt Redisは、TSVインポートなどの非同期処理に使用しています。
https://railsguides.jp/active_job_basics.html
https://github.com/resque/resque

GCPは経験がないのですが、Memorystore for Redisはデータの永続化が行われないとドキュメントにあり、インポートが失敗したときなどの情報が残らないかもしれません。

なお、現在のDocker版では使用していませんが、Redisはキャッシュの保存先に使用することもできます。
https://railsguides.jp/caching_with_rails.html#activesupport-cache-rediscachestore

@shin1kt
Copy link
Author

shin1kt commented May 19, 2024

@nabeta
ご丁寧な回答ありがとうございます。なるほどインポートが失敗して接続が切れたときに問題がでるかもしれないということですね。いただいたヒントを元に調査して判断していきたいと思います。

Redisはキャッシュの保存先

ちなみに

docker compose run --rm web bundle exec rake sunspot:reindex

sunspotのreindexをするときにredisコンテナが起動しているようですが、solrのキャッシュをredisに保存しているというわけではないのでしょうか。

@shin1kt
Copy link
Author

shin1kt commented May 19, 2024

すみません。webのdepends onにsolrが設定されているから起動しているだけで、sunspotと関係しているわけではないですね。失礼しました。

@nabeta
Copy link
Member

nabeta commented May 21, 2024

@shin1kt Redisに保存されるキャッシュは、HTMLの一部になります。
https://railsguides.jp/caching_with_rails.html#%E3%83%95%E3%83%A9%E3%82%B0%E3%83%A1%E3%83%B3%E3%83%88%E3%82%AD%E3%83%A3%E3%83%83%E3%82%B7%E3%83%A5

@shin1kt
Copy link
Author

shin1kt commented May 22, 2024

@nabeta
ありがとうございます。キャッシュについては引き続き確認して理解を深めたいと思います。
質問の意図としては返答いただけましたのでコメントを閉じさせていただきます。

@shin1kt shin1kt closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants