The concept of a leaderboard—a scoreboard showing the ranked names and current scores (or other data points) of the leading competitors—is essential to the world of computer gaming, but leaderboards are now about more than just games. They are about gamification, a broader implementation that can include any group of people with a common goal (coworkers, students, sales groups, fitness groups, volunteers, and so on).
Leaderboards can encourage healthy competition in a group by openly displaying the current ranking of each group member. They also provide a clear way to view the ongoing achievements of the entire team as members move towards a goal. Gamification of tasks and goals via leaderboards is a great way to motivate people by providing them with constant feedback of where they rank in comparison to other group members. Done well, this can lead to healthy competition that builds group cohesion.
- Docker (on mac: https://docs.docker.com/docker-for-mac/install/)
- Docker Compose
Provide the values for environment variables (if needed)
If you're using Redis Enterprise Cloud, you must supply DB endpoint, password, port and the name of the database. In case of local system, the entries look like as shown below:
- Install gradle
Follow the following link https://gradle.org/install/ for your MacOS
- Install JDK
Follow the following link https://docs.oracle.com/javase/10/install/installation-jdk-and-jre-macos.htm for your MacOS
To use Wrapper, we need to generate some particular files. We'll generate these files using the built-in Gradle task called wrapper. Note that we need to generate these files only once.
Now, let's run the wrapper task in our project directory:
It should show the below results:
The Gradle Wrapper is now available for building your project. It's time to run the wrapper script to perform the build task.
The AAPL's details - market cap of 2.6 triillions and USA origin - are stored in a hash like below:HSET "company:AAPL" symbol "AAPL" market_cap "2600000000000" country USA
The Ranks of AAPL of 2.6 trillions are stored in a ZSET.ZADD companyLeaderboard 2600000000000 company:AAPL
Top 10 companies:ZREVRANGE companyLeaderboard 0 9 WITHSCORES
All companies:ZREVRANGE companyLeaderboard 0 -1 WITHSCORES
Bottom 10 companies:ZRANGE companyLeaderboard 0 9 WITHSCORES
Between rank 10 and 15:ZREVRANGE companyLeaderboard 9 14 WITHSCORES
Show ranks of AAPL, FB and TSLA:ZREVRANGE companyLeaderBoard company:AAPL company:FB company:TSLA
Adding 1 billion to market cap of FB company:ZINCRBY companyLeaderBoard 1000000000 "company:FB"
Reducing 1 billion of market cap of FB company:ZINCRBY companyLeaderBoard -1000000000 "company:FB"
Companies between 500 billion and 1 trillion:ZCOUNT companyLeaderBoard 500000000000 1000000000000
Companies over a Trillion:ZCOUNT companyLeaderBoard 1000000000000 +inf