-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
docs(memorystore): added valkey leaderboard guide #10006
base: main
Are you sure you want to change the base?
docs(memorystore): added valkey leaderboard guide #10006
Conversation
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.
Hi team,
I'm currently reviewing this pull request and will provide my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed:
This pull request adds a comprehensive guide on building a leaderboard service using Google Cloud's Memorystore (Valkey), Spring Boot, and PostgreSQL. The intent is to provide a practical example of leveraging in-memory caching for improved performance and scalability in leaderboard applications.
Here's a breakdown of the changes:
- New File:
memorystore/valkey/leaderboard/GUIDE.md
was added. This file contains a detailed guide (166 lines) covering the following aspects:- Benefits of Cached Leaderboards: Performance, scalability, and database efficiency improvements are highlighted.
- Architecture Overview: Illustrates the interaction between the Spring Boot application, Memorystore (Valkey), PostgreSQL, and GCP services.
- Step-by-Step Guide: Provides a walkthrough on creating a Spring Boot application, adding necessary dependencies (Jedis and Jakarta Validation), connecting to the service layer, and initializing the cache.
- Code Examples: Includes Java code snippets demonstrating cache initialization, fetching leaderboards (ascending/descending), user search, and score updates.
- Scaling and Optimization: Discusses strategies for scaling the application horizontally using Cloud Run, Memorystore, and Cloud SQL.
- Conclusion: Summarizes the benefits of the implemented system.
The checklist in the pull request description indicates that all required tests and linting checks have been performed. The author also updated the CODEOWNERS and Blunderbuss files accordingly.
I'll provide a more detailed review shortly.
Here's a little haiku to brighten your day:
Scores flash, swift and bright,
Valkey's cache, a speed demon,
Ranks leap into view.
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.
This pull request adds a guide for building a leaderboard service using Valkey, Spring Boot, and PostgreSQL. The guide is well-written and provides a good overview of the architecture and workflow. I have a few suggestions for improvement:
Summary of Google Java Style Guide elements referenced:
- Function/Method naming conventions
- Code comments
I've also included some general feedback and suggestions for the README.
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.
What is a purpose of this guide? Based on the content it explains a demo application which is out of scope of this repository.
This repository is intended for hosting short code samples that demonstrate a use of one or more methods of client libraries to perform a single task. They are used as code snippets in the public documentation and aren't intended for use outside of this.
Please let us know if you need assistance in finding a proper repository to host the source code for your demo application.
To ensure that our api routes are correctly validated. Add the following dependency. | ||
This dependency enables the use of annotations like `@NotNull` and `@Size` on classes to automatically enforce input constraints, reducing the need for manual validation logic. | ||
|
||
```xml | ||
<!-- Add Validation support--> | ||
<dependency> | ||
<groupId>jakarta.validation</groupId> | ||
<artifactId>jakarta.validation-api</artifactId> | ||
<version>3.0.2</version> | ||
</dependency> | ||
``` |
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.
why MemoryStore code sample requires Jakarta?
Hi there, this is a guide relating to the demo code here: |
Thank you, @cabljac for the context. |
Description
Fixes #
Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.
Checklist
pom.xml
parent set to latestshared-configuration
mvn clean verify
requiredmvn -P lint checkstyle:check
requiredmvn -P lint clean compile pmd:cpd-check spotbugs:check
advisory only