HTTP-based mini game back-end in Java which registers score points for different users, with the capability to return the current user position and high score list.
Java 8 Maven
I redid the test without using a Redis cache, instead of a cache, I used the map.
ConcurrentMap introduced in Java in version 1.5, it is a high-performance, thread-safety map.
With this decision I can get: thread-safety with high throughput under high concurrency
Knowing that my performance tests are merely superficial and do not serve as an advanced basis for stress testing, I would like to share the results obtained When performing 1 insertion via API where a for has inserted 21k players on the map, I obtained response time 300ms, when saving only 1 item it was 9ms the response time
Bearing in mind that the biggest difficulty of performance will be to seek both highscore and getPosition I obtained values of 150 ms for 20k high score saved, fetched via API GET
and 39 ms to search for the player's position, on a map with 21,000 records.
For this solution I used DDD (Domain Driven Design) and developed based on TDD
mvn clean package && java -jar target/score-user-0.0.1-SNAPSHOT.jar
mvn clean package -Dmaven.test.skip=true
http://localhost:8080/swagger-ui.html#/
http://localhost:8080/v2/api-docs
For further reference, please consider the following sections:
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Create an OCI image
- Spring Boot DevTools
- Spring Web
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Saulo Silva
This project is licensed under the MIT License