-
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 demo application #10007
base: main
Are you sure you want to change the base?
docs(memorystore): added valkey leaderboard demo application #10007
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 @dackers86 and reviewers,
I'm currently reviewing this pull request and will post my feedback in a few minutes. In the meantime, here's a summary of the changes for you and other reviewers to quickly get up to speed:
This pull request adds a leaderboard demo application that uses Valkey as an in-memory cache to accelerate data retrieval. The application allows users to add or update their scores, and retrieve the top entries from the leaderboard. The application is built using Spring Boot and connects to a PostgreSQL database.
Here's a breakdown of the changes:
memorystore/valkey/leaderboard/README.md
: This file was updated to include instructions on how to run the application locally, via Docker, and how to deploy it to Google Cloud. The instructions cover setting up PostgreSQL and Valkey, creating database tables, building and running the application, and deploying to Google Cloud Run using Terraform. The file also describes the API endpoints for interacting with the leaderboard.memorystore/valkey/leaderboard/app/.gitignore
: This file was added to ignore various files and directories generated by the build process, IDEs, and other tools.memorystore/valkey/leaderboard/app/Dockerfile
: This file was added to define the Docker image for the application. It uses an OpenJDK base image, installs Maven, copies the project files, builds the application, copies the JAR file, exposes port 8080, and runs the application.memorystore/valkey/leaderboard/app/docker-compose.yaml
: This file was added to define the Docker Compose configuration for running the application, Valkey, and PostgreSQL together.memorystore/valkey/leaderboard/app/init.sql
: This file was added to create theleaderboard
table in the PostgreSQL database, including indexes for efficient sorting.memorystore/valkey/leaderboard/app/main.tf
: This Terraform configuration file was added to deploy the application's infrastructure to Google Cloud, including a Cloud Run service, a Valkey instance, and a Cloud SQL instance.memorystore/valkey/leaderboard/app/pom.xml
: This file was updated to include the necessary dependencies for the application, including Spring Boot, Jedis (Redis client), PostgreSQL JDBC driver, and Thymeleaf.memorystore/valkey/leaderboard/app/src/main/java/*
: Several Java files were added or modified to implement the application's logic, including controllers, repositories, data models, and configuration classes. These files handle API requests, database interactions, caching with Valkey, and rendering the leaderboard.memorystore/valkey/leaderboard/sample-data/.gitignore
: This file was added to ignore various files and directories generated by the build process, IDEs, and other tools for the sample data application.memorystore/valkey/leaderboard/sample-data/Dockerfile
: This file was added to define the Docker image for the sample data application.memorystore/valkey/leaderboard/sample-data/docker-compose.yaml
: This file was added to define the Docker Compose configuration for running the sample data application, Valkey, and PostgreSQL together.memorystore/valkey/leaderboard/sample-data/pom.xml
: This file contains the project dependencies for the sample data application.memorystore/valkey/leaderboard/sample-data/src/main/java/app/Main.java
: This file contains the main application logic for the sample data application, which populates the database with sample leaderboard entries.
The author has also completed the checklist provided in the pull request description.
Let me know if you have any questions.
Small code, big impact,
Leaderboard's shining bright,
Data flows so fast!
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 Valkey leaderboard demo application. The documentation is comprehensive and covers running locally, with Docker, and deploying to Google Cloud. The code appears functional and well-structured. Here are a few suggestions for improvement:
Summary of Google Java Style Guide elements referenced:
- Javadoc comments should be present for public classes and methods.
- Constants should be named in UPPER_SNAKE_CASE.
- Braces should be used even for single-line if statements.
- Indentation should be 4 spaces.
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 repository is not intended for storing demo applications. Please close this PR and migrate the code to another repo. We will be happy to collaborate and help you to find the correct repository for this demo app or create a new one.
memorystore/valkey/leaderboard/app/src/main/java/app/LeaderboardResponse.java
Outdated
Show resolved
Hide resolved
chore(memorystore-valkey-leaderboard): lint fixes for LeaderboardController chore(memorystore-valkey-leaderboard): lint fixes for DataController.java chore(memorystore-valkey-leaderboard): lint fixes for JedisConfig.java chore(memorystore-valkey-leaderboard): lint fixes for LeaderboardEntry.java chore(memorystore-valkey-leaderboard): lint fixes for FromCacheType.java chore(memorystore-valkey-leaderboard): lint fixes for OrderByType, LeaderboardResponse chore(memorystore-valkey-leaderboard): lint fixes for LeaderboardRepository chore(memorystore-valkey-leaderboard): lint fixes for JdpcConfig chore(memorystore-valkey-leaderboard): lint fixes for WebConfig chore(memorystore-valkey-leaderboard): lint fixes for remaining files chore(memorystore-valkey-leaderboard): lint fixes for sample-data chore(memorystore-valkey-leaderboard): more lint fixes
d9b5d84
to
240804e
Compare
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