-
-
Notifications
You must be signed in to change notification settings - Fork 26
Add cache to DynamoDB App Manager #150
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
Conversation
Summary of ChangesHello @lilfaf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the performance of the DynamoDB App Manager by integrating an in-memory caching layer. This change aims to minimize direct calls to DynamoDB for frequently accessed application data, thereby improving response times and reducing the load on the database. The caching mechanism is designed to be highly configurable and aligns with existing caching strategies within the system, ensuring consistency and maintainability. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
69ce969 to
bf4daed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a caching layer using the moka library for the DynamoDbAppManager to improve performance by caching application data. The changes include adding cache_ttl and cache_max_capacity configuration options, integrating cache lookup and population into find_by_id, create_app, update_app, and find_by_key methods, and invalidating cache entries on delete_app. A local DynamoDB service was added to docker-compose.test.yml along with extensive unit tests to verify the cache's behavior, including hits, misses, expiration, and invalidation. Review comments suggest changing the cache invalidation method from remove to invalidate in delete_app for better API adherence and removing cache population from the get_apps method to prevent cache churn and high memory usage, recommending organic cache warming instead.
bf4daed to
f90cde7
Compare
The DynamoDB App Manager was missing in-memory caching, causing every find_by_id() call to query DynamoDB directly. - Add Moka cache with configurable TTL and max capacity - Cache apps on create, update, and retrieval - Invalidate cache on delete - Support global CACHE_TTL_SECONDS and CACHE_MAX_CAPACITY env vars - Add DynamoDB Local to docker-compose.test.yml and CI workflow - Add unit tests for cache behavior, invalidation, and TTL expiration This matches the caching pattern already used in other app managers.
f90cde7 to
53b8e04
Compare
The DynamoDB App Manager was missing in-memory caching, causing every
find_by_id()call to query DynamoDB directly.This matches the caching pattern already used in other app managers.
Description
Type of Change
Testing
Checklist
Build Artifacts
Additional Notes