For run application:
- Download source from github
- Change directory to root project folder
- Use gradle for start the app:
./gradlew bootRunAfter the run application you can see the log like that
Jetty started on port(s) 9090 (http/1.1) with context path '/'
Started DiffApplication in 2.078 seconds (JVM running for 2.392)
Swagger endpoint for localhost: http://localhost:9090/swagger-ui.html
Another variant start app via docker:
- Download source from github
- Change directory to root project folder
- Use gradle to create docker image (you have already installed docker service on you computer), command:
./gradlew dockerBuildImage - After creation image check the image:
docker images, there have to be image with name:ru.serdyuk/diff-data:0.0.1-snapshot - Run the image:
docker run -p 9090:9090 ru.serdyuk/diff-data:0.0.1-snapshot
Swagger endpoint for localhost: http://localhost:9090/swagger-ui.html
POST /v1/diff/{key}/left - put first value
POST /v1/diff/{key}/right - put second value
GET /v1/deff/{key} - get result
Keep in mind, is it not final version, and the storage (for values) persists values, good way to implement external storage with evictions policy. It might be mongodb or some distributed cache (like redis or hazelcast).
For future releases:
- cloud storage implementation
- integration tests
- docker-compose (with external storage)
- vegeta load test
- graal compiler